-
Notifications
You must be signed in to change notification settings - Fork 45
101 lines (83 loc) · 2.66 KB
/
ci.yaml
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
name: CI
# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
branches: [master]
jobs:
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
cabal: ["3.12"]
ghc:
# GHC versions listed as current stable releases
- "9.2.8"
- "9.4.8"
- "9.6.6"
- "9.8.2"
- "9.10.1"
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup-haskell-cabal
name: Setup GHC and cabal-install
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Configure
run: |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
- name: Freeze
run: |
cabal freeze
- uses: actions/cache@v4
name: Cache ~/.cabal/store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-${{ hashFiles('cabal.project.freeze') }}
- name: Install dependencies
run: |
cabal build all --only-dependencies
- name: Build
run: |
cabal build all
- name: Test the test-suite test
run: |
cabal test path:test
# - name: Test the test-suite validity-test
# run: |
# cabal test path:validity-test
# As of 2024-07-29, the GitHub-hosted runner on ubuntu-latest comes with
# Stack 2.15.7 and GHC 9.10.1.
stack:
name: "stack / ghc ${{ matrix.ghc }} (${{ matrix.stack-yaml }})"
runs-on: ubuntu-latest
strategy:
matrix:
ghc: ["9.10.1"]
stack-yaml:
- "stack.yaml"
- "stack.os-string.yaml"
steps:
- name: Clone project
uses: actions/checkout@v4
- name: Cache Stack root
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack-${{ hashFiles(format('{0}.lock', matrix.stack-yaml)) }}
- name: Install dependencies
run: |
stack --stack-yaml "${{ matrix.stack-yaml }}" build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
- name: Build
run: |
stack --stack-yaml "${{ matrix.stack-yaml }}" build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
- name: Test the test-suite test
run: |
stack --stack-yaml "${{ matrix.stack-yaml }}" test path:test:test --system-ghc
# - name: Test the test-suite validity-test
# run: |
# stack test path:test:validity-test --system-ghc