Skip to content

Commit fc34dd4

Browse files
committed
ci: Add github action
1 parent 487c076 commit fc34dd4

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/haskell.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: github-action
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
ghc: ['8.6.5', '8.10.7']
10+
os: ['ubuntu-latest', 'macos-latest']
11+
runs-on: ${{ matrix.os }}
12+
13+
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: haskell/actions/setup@v2
17+
with:
18+
ghc-version: ${{ matrix.ghc }}
19+
- name: Cache
20+
uses: actions/cache@v1
21+
env:
22+
cache-name: cache-cabal
23+
with:
24+
path: ~/.cabal
25+
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
26+
restore-keys: |
27+
${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-
28+
${{ runner.os }}-${{ matrix.ghc }}-build-
29+
${{ runner.os }}-${{ matrix.ghc }}-
30+
${{ runner.os }}
31+
- name: Install dependencies
32+
run: |
33+
cabal update
34+
cabal build --only-dependencies --enable-tests --enable-benchmarks
35+
- name: Build
36+
run: cabal build --enable-tests --enable-benchmarks all
37+
- name: Run tests
38+
run: cabal test all

0 commit comments

Comments
 (0)