Skip to content

Commit

Permalink
Merge pull request #73 from Nike-Inc/ci/github-actions
Browse files Browse the repository at this point in the history
Ci/GitHub actions
  • Loading branch information
IamfromSpace authored Jan 15, 2021
2 parents fcae0b1 + df32a94 commit 34b255b
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 196 deletions.
11 changes: 11 additions & 0 deletions .github/actions/install_stack/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'Install Stack'
description: 'Install the Haskell Stack build tool'
runs:
using: "composite"
steps:
- name: Install
run: |
export PATH=$HOME/.local/bin:$PATH
mkdir -p ~/.local/bin
curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
shell: bash
58 changes: 58 additions & 0 deletions .github/workflows/haskell_cabal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Cabal Haskell Builds

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
strategy:
matrix:
plan:
- ghc-version: '8.0.2'
cabal-version: '2.0'
- ghc-version: '8.2.2'
cabal-version: '2.2'
- ghc-version: '8.4.4'
cabal-version: '2.2'
- ghc-version: '8.8'
cabal-version: '3.0'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ matrix.plan.ghc-version }}
- name: Install Cabal
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.plan.ghc-version }}
cabal-version: ${{ matrix.plan.cabal-version }}
- name: Install Project Dependencies (Cabal v3)
run: |
set -ex
cabal install --lib --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1
set +ex
if: "startsWith(matrix.plan.cabal-version, '3')"
- name: Install Project Dependencies (Cabal v2)
run: |
set -ex
cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1
set +ex
if: "!startsWith(matrix.plan.cabal-version, '3')"
- name: Build Project
run: |
set -ex
cabal configure --enable-tests --ghc-options -O0
cabal build
cabal test
set +ex
50 changes: 50 additions & 0 deletions .github/workflows/haskell_stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Stack Haskell Builds

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
resolver:
- lts-11
- lts-12
- lts-13
experimental:
- false
include:
- resolver: nightly
experimental: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.stack
.stack-work
key: ${{ matrix.resolver }}
- name: Install Stack
uses: ./.github/actions/install_stack
- name: Install Project Dependencies
run: |
set -ex
stack --no-docker --no-terminal --install-ghc --resolver $RESOLVER test --bench --only-dependencies
set +ex
env:
RESOLVER: ${{ matrix.resolver }}
- name: Build Project
run: |
set -ex
stack --no-docker --no-terminal --resolver $RESOLVER test --bench --no-run-benchmarks --haddock --no-haddock-deps
set +ex
env:
RESOLVER: ${{ matrix.resolver }}
32 changes: 32 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish to Hackage

on:
push:
tags:
- "v?[0-9]+.[0-9]+.[0-9]+"
- "v?[0-9]+.[0-9]+.[0-9]+.[0-9]+"

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.stack
.stack-work
key: publish
- name: Install Stack
uses: ./.github/actions/install_stack
# TODO: It's possible that the tag and the package version don't match,
# which would indicate an error and should abort the publish
- name: Publish Project
run: |
set -ex
stack --no-docker upload .
set +ex
env:
HACKAGE_USERNAME: ${{ secrets.HackageUsername }}
HACKAGE_PASSWORD: ${{ secrets.HackagePassword }}
180 changes: 0 additions & 180 deletions .travis.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .travis/deploy.sh

This file was deleted.

6 changes: 4 additions & 2 deletions hal.cabal
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.34.2.
-- This file has been generated from package.yaml by hpack version 0.33.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 2175dc8b8db69d64e82ae49c3130cc5d820d63bc28a956f8d4aa3af961c4ddb5

name: hal
version: 0.4.4
version: 0.4.5
synopsis: A runtime environment for Haskell applications running on AWS Lambda.
description: This library uniquely supports different types of AWS Lambda Handlers for your
needs/comfort with advanced Haskell. Instead of exposing a single function
Expand Down
3 changes: 3 additions & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ docker:

# https://docs.haskellstack.org/en/stable/yaml_configuration/#pvp-bounds
pvp-bounds: lower-revision

# We don't ever want or need our Hackage Credentials written to disk
save-hackage-creds: false

0 comments on commit 34b255b

Please sign in to comment.