-
Notifications
You must be signed in to change notification settings - Fork 28
98 lines (98 loc) · 3.94 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI
on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
types:
- opened
- synchronize
paths-ignore:
- 'docs/**'
- '*.md'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
cabal: ["3.10.1.0"]
ghc: ["9.2", "9.4" , "9.6" , "9.8"]
env:
CONFIG: "--enable-tests"
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
cabal-update: true
- name: Configure
run: cabal configure $CONFIG
- name: Ensure buildability with GHC-shipped versions of dependencies
# Fix all GHC-shipped libraries to their installed version.
# This list is a superset of libraries that are actually used during the build,
# but this does not matter, as it does not entail that all these libraries are built.
run: |
cat >> cabal.project.local <<EOF
constraints: Cabal installed
constraints: Cabal-syntax installed
constraints: array installed
constraints: base installed
constraints: binary installed
constraints: bytestring installed
constraints: containers installed
constraints: deepseq installed
constraints: directory installed
constraints: exceptions installed
constraints: filepath installed
constraints: ghc installed
constraints: ghc-bignum installed
constraints: ghc-boot installed
constraints: ghc-boot-th installed
constraints: ghc-compact installed
constraints: ghc-heap installed
constraints: ghc-prim installed
constraints: ghci installed
constraints: haskeline installed
constraints: hpc installed
constraints: integer-gmp installed
constraints: libiserv installed
constraints: mtl installed
constraints: parsec installed
constraints: pretty installed
constraints: process installed
constraints: rts installed
constraints: semaphore-compat installed
constraints: stm installed
constraints: system-cxx-std-lib installed
constraints: template-haskell installed
constraints: terminfo installed
constraints: text installed
constraints: time installed
constraints: transformers installed
constraints: unix installed
constraints: xhtml installed
EOF
- name: Construct the build plan
run: cabal build --dry-run
# The dry-run generates the build plan 'dist-newstyle/cache/plan.json'.
# The freeze file is not suitable for a cache key as it contains the hackage timestamp,
# which updates for every run of this action (via `cabal update`).
- uses: actions/cache@v3
env:
key: ${{ runner.os }}-ghc-${{ steps.setup-haskell-cabal.outputs.ghc-version }}-cabal-${{ steps.setup-haskell-cabal.outputs.cabal-version }}
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
key: ${{ env.key }}-plan-${{ hashfiles('dist-newstyle/cache/plan.json') }}
restore-keys: ${{ env.key }}-
- run: cabal build --dependencies-only
- run: cabal build
- run: cabal test
- run: cabal haddock
- run: cabal sdist