Repository navigation
119 lines (102 loc) · 3.7 KB
/
Copy pathcabal.yml
File metadata and controls
119 lines (102 loc) · 3.7 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Continuous integration
on:
push:
branches: ['master']
paths-ignore:
- 'README.md'
- 'CONTRIBUTING.md'
pull_request:
branches: ['master']
jobs:
tests:
# You can skip continuous integration by writing '[ci skip]' or '[skip ci]' in a commit message,
# which is useful to preserve computing resources
#
# For example:
# > git commit -am "[skip ci] fixed x y z"
if: contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
strategy:
fail-fast: false
matrix:
ghc-version:
- "8.10"
- "9.0"
- "9.2"
- "9.4"
- "9.6"
- "9.8"
- "9.10"
- "9.12"
- "9.14"
# `ubuntu-latest` doesn't include the linker that GHC 9.2.8 and 9.4.8
# expect, leading to build failures
runs-on: "ubuntu-24.04"
steps:
- uses: actions/checkout@v4
- name: Install cabal/ghc
uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc-version }}
cabal-version: '3.16.1.0'
- name: Generate freeze file
run: |
# Cloud Haskell tests using the QUIC backend are quite flaky, but in CI only.
# Therefore, the 'quic' flag is normally enabled locally, but disabled in CI.
cabal configure --test-show-details=direct
cabal freeze --minimize-conflict-set
cat cabal.project.freeze
- name: Cache cabal work
uses: actions/cache@v4
with:
path: |
dist-newstyle
${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-ghc-${{ matrix.ghc-version }}-${{ hashFiles('cabal.project', 'cabal.project.local', 'cabal.project.freeze') }}
restore-keys: |
${{ runner.os }}-ghc-${{ matrix.ghc-version }}-
- name: Build dependencies only
run: cabal build all --only-dependencies
- name: Build all packages
run: cabal build all
- name: Run all tests
# We have seen in the past some tests hang for hours, wasting resources.
# The timeout below should be plenty
timeout-minutes: 10
# We run each test suite one-by-one to better observe problems.
run: cabal test all -j1
benchmark:
# You can skip continuous integration by writing '[ci skip]' or '[skip ci]' in a commit message,
# which is useful to preserve computing resources
#
# For example:
# > git commit -am "[skip ci] fixed x y z"
if: contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
runs-on: ubuntu-latest
env:
# See issue 479 for when we can move up to GHC 9.14
GHC_VERSION: '9.12'
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ env.GHC_VERSION }}
- name: Configure build
run: |
cabal configure --disable-tests --semaphore -j
# Generate a plan.json
cabal build all --project-file=cabal.optimized.project --dry-run
- name: Cache cabal store
uses: actions/cache@v4
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-benchmark-${{ hashFiles('**/plan.json') }}
restore-keys: |
${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-benchmark
- name: Build
run: cabal build all --project-file=cabal.optimized.project
# Run benchmarks with j1 so that we don't get interleaved output
- name: Run benchmarks
run: |
cabal bench all -j1 --project-file=cabal.optimized.project