-
Notifications
You must be signed in to change notification settings - Fork 91
90 lines (81 loc) · 2.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Haskell CI
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc: ['9.8', '9.6', '9.4', '9.2', '9.0.2', '8.10.7', '8.8.4', '8.6.5']
os: [ubuntu-latest]
ospath: [true, false]
exclude:
# newer 'entropy' doesn't work with old 'unix', and it doesn't have a correct version bound.
- ospath: true
ghc: '8.6.5'
# "cabal build" always timeout
- ospath: true
ghc: '8.8.4'
os: windows-latest
include:
- os: macOS-latest
ghc: '9.8'
ospath: true
- os: macOS-latest
ghc: '9.8'
ospath: false
- os: windows-latest
ghc: '9.8'
ospath: true
- os: windows-latest
ghc: '9.8'
ospath: false
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
cabal-update: true
- name: Cabal cache
uses: actions/cache@v3
env:
cache-name: cabal
with:
path: ~/.cabal
key: ${{ runner.os }}-build-${{ env.cache-name }}-ghc-${{ steps.setup.outputs.ghc-version}}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-ghc-${{ steps.setup.outputs.ghc-version}}-
- name: Stack cache
uses: actions/cache@v3
env:
cache-name: stack
with:
path: ~/.stack
key: ${{ runner.os }}-build-${{ env.cache-name }}-ghc-${{ steps.setup.outputs.ghc-version}}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/stack.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-ghc-${{ steps.setup.outputs.ghc-version}}-
- name: Cabal configure
shell: bash
run: |
if [ ${{ matrix.ospath }} = "true" ]; then
cabal configure --flags="force-ospath"
fi
- name: Build using cabal
run: cabal build all
- name: Test
run: cabal test all
# stack build uses stack.yaml which actually uses ghc-8.10.7
- if: matrix.ghc == '8.10.7' && runner.os == 'Linux'
name: Build using stack
run: stack build
haskell_post_job:
runs-on: ubuntu-latest
needs: [ build ]
steps:
- run: |
echo "jobs info: ${{ toJSON(needs) }}"
- if: contains(needs.*.result, 'failure')
run: exit 1
- if: contains(needs.*.result, 'cancelled') && needs.pre_job.outputs.should_skip != 'true'
run: exit 1