-
Notifications
You must be signed in to change notification settings - Fork 7
78 lines (67 loc) · 2.07 KB
/
ci.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Continuous integration
on:
push:
branches: main
pull_request:
branches: main
workflow_dispatch: # allows manual triggering
env:
# Bump this number to invalidate the GH actions cache
cache-version: 0
jobs:
build:
strategy:
matrix:
ghc: ['9.0.2', '9.2.7', '9.4.4', '9.6.1']
cabal: ['3.4.1.0', '3.6.2.0', '3.8.1.0', '3.10.1.0']
os: ['ubuntu-latest', 'macos-latest']
exclude:
# Cabal 3.4.1.0 supports GHC version < 9.1
- cabal: '3.4.1.0'
ghc: '9.2.7'
- cabal: '3.4.1.0'
ghc: '9.4.4'
- cabal: '3.4.1.0'
ghc: '9.6.1'
# Cabal 3.6.2.0 supports GHC version < 9.4
- cabal: '3.6.2.0'
ghc: '9.4.4'
- cabal: '3.6.2.0'
ghc: '9.6.1'
runs-on: ${{ matrix.os }}
name: platform ${{ matrix.os }} GHC ${{ matrix.ghc }} cabal ${{ matrix.cabal }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Haskell
id: setup-haskell
uses: haskell/actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Cache
uses: actions/cache@v3
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
- name: Update cabal package list
run: cabal update
- name: Build dependencies
run: cabal build --only-dependencies
- name: Build
run: cabal build -f errors
- name: Test on current dependencies
run: cabal test
- name: Test on most recent dependencies
run: cabal test --index-state HEAD
- name: Test on oldest dependencies
if: matrix.cabal == '3.10.1.0'
run: cabal test --prefer-oldest
format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check code formatting
uses: fourmolu/fourmolu-action@v6