-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (49 loc) · 1.62 KB
/
haskell.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Haskell CI
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
ghc: ["8.10.7", "9.2.8", "9.6.2", "9.8.1"]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- uses: haskell/actions/setup@v1
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: latest
- name: Haskell versions
run: |
ghc --version
cabal --version
- name: Cabal update
run: cabal update
- name: Cabal Configure
run: cabal build all --dry-run --enable-tests --enable-benchmarks --write-ghc-environment-files=always
- name: Record dependencies
run: |
cat dist-newstyle/cache/plan.json | jq -r '."install-plan"[].id' | sort | uniq > dependencies.txt
- name: Set cache version
run: echo "CACHE_VERSION=9w76Z3Qx" >> $GITHUB_ENV
- uses: actions/cache@v2
name: Cache cabal store
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
restore-keys: |
cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-
- name: Install dependencies
run: |
cabal update
cabal build all --only-dependencies
- name: Build
run: cabal build all
- name: Run tests
run: cabal test all