-
Notifications
You must be signed in to change notification settings - Fork 20
104 lines (96 loc) · 2.4 KB
/
haskell-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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Build cabal project
on:
workflow_dispatch:
pull_request:
types:
- synchronize
- opened
- reopened
merge_group:
push:
branches:
- main
schedule:
# Run once per day (at UTC 18:00) to maintain cache:
- cron: 0 18 * * *
jobs:
build:
name: ${{ matrix.os }}-ghc-${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.allow-failure }}
env:
cabal-build-dir: b
strategy:
matrix:
allow-failure:
- false
os:
- ubuntu-latest
cabal:
- latest
ghc:
- 8.0.2
- 8.2.2
- 8.4.4
- 8.6.5
- 8.8.4
- 8.10.7
- 9.2.8
- 9.4.7
- 9.6.6
- 9.8.2
- 9.10.1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Environment
uses: haskell-actions/setup@v2
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Configure
run: >
cabal configure
--builddir=${{ env.cabal-build-dir }}
--enable-tests
--enable-benchmarks
--enable-documentation
--test-show-details=direct
--write-ghc-environment-files=always
- name: Freeze
run: >
cabal freeze
--builddir=${{ env.cabal-build-dir }}
- name: Cache
uses: actions/cache@v3
env:
hash: ${{ hashFiles('cabal.project.freeze') }}
with:
key: ${{ matrix.os }}-ghc-${{ matrix.ghc }}-${{ env.hash }}
restore-keys: |
${{ matrix.os }}-ghc-${{ matrix.ghc }}-
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
${{ env.cabal-build-dir }}
- name: Dependencies
run: >
cabal build all
--builddir=${{ env.cabal-build-dir }}
--only-dependencies
- name: Build
run: >
cabal build all
--builddir=${{ env.cabal-build-dir }}
--enable-tests
--enable-benchmarks
--ghc-options=-Wall
- name: Test
run: >
cabal test all
--builddir=${{ env.cabal-build-dir }}
- name: Benchmark
run: >
cabal bench all
--builddir=${{ env.cabal-build-dir }}
|| true