Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lehins committed Jul 4, 2020
1 parent fac4ee3 commit 3801380
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 19 deletions.
37 changes: 18 additions & 19 deletions .github/workflows/haskell.yml
Expand Up @@ -13,28 +13,27 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-haskell@v1
with:
ghc-version: '8.8.2'
cabal-version: '3.0'

- name: Cache
uses: actions/cache@v1
env:
cache-name: cache-cabal
uses: actions/cache@v2.0.0
with:
path: ~/.cabal
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
# A list of files, directories, and wildcard patterns to cache and restore
path:
- "~/.stack"
- "massiv-examples/.stack-work"
- "massiv-examples/GameOfLife/.stack-work"
- "massiv-examples/examples/.stack-work"
- "massiv-examples/vision/.stack-work"
# An explicit key for restoring and saving the cache
key: "${{ GITHUB_ACTOR }}/${{ GITHUB_REF }}"
restore-keys: "*/master"

- name: Install dependencies
run: |
cabal update
cabal build --only-dependencies --enable-tests --enable-benchmarks
- name: Build
run: cabal build --enable-tests --enable-benchmarks all
- name: Run tests
run: cabal test all
cd massiv-examples
curl -sSL https://get.haskellstack.org/ | sh -s - -f
curl -sSL https://gist.githubusercontent.com/lehins/fd36a8cc8bf853173437b17f6b6426ad/raw/d9ddb32cac2f0dc6800be4fa54d450f0dcda6c60/git-modtime.hs -o git-modtime.hs
stack script --resolver lts-16 git-modtime.hs
- name: Test
run: |
stack test --bench --no-run-benchmarks --haddock --no-haddock-deps
12 changes: 12 additions & 0 deletions massiv-examples/stack.yaml
@@ -0,0 +1,12 @@
resolver: lts-16.3

packages:
- GameOfLife
- vision
- examples
extra-deps:
- ../massiv
- Color-0.2.0@sha256:94c43c4d8f943ba0642ee58a9b8a665b01a3ac2893c40a16ffdabaacb956c58f,8159
- massiv-io-0.3.0.1@sha256:393df632ea8c3b0549a2b3a2fbaa6a9ef1202a05dd9b3f44555a9f6a31327652,3667
nix:
packages: [ zlib libGLU ]

0 comments on commit 3801380

Please sign in to comment.