Skip to content

Commit 38714b9

Browse files
committed
ci: Add github action
1 parent d990eed commit 38714b9

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/haskell.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: github-action
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
ghc: ['8.0.2', '8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.2']
10+
os: ['ubuntu-latest', 'macos-latest']
11+
exclude:
12+
# There are some linker warnings in 802 on darwin that
13+
# cause compilation to fail
14+
# See https://github.com/NixOS/nixpkgs/issues/25139
15+
- ghc: '8.0.2'
16+
os: 'macos-latest'
17+
runs-on: ${{ matrix.os }}
18+
19+
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/setup-haskell@v1
23+
with:
24+
ghc-version: ${{ matrix.ghc }}
25+
- name: Cache
26+
uses: actions/cache@v1
27+
env:
28+
cache-name: cache-cabal
29+
with:
30+
path: ~/.cabal
31+
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
32+
restore-keys: |
33+
${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-
34+
${{ runner.os }}-${{ matrix.ghc }}-build-
35+
${{ runner.os }}-${{ matrix.ghc }}-
36+
${{ runner.os }}
37+
38+
- name: Install dependencies
39+
run: |
40+
cabal update
41+
cabal build --only-dependencies --enable-tests --enable-benchmarks
42+
- name: Build
43+
run: cabal build --enable-tests --enable-benchmarks all
44+
- name: Run tests
45+
run: cabal test all

0 commit comments

Comments
 (0)