-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (50 loc) · 1.65 KB
/
tests.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
name: tests
on:
pull_request:
jobs:
cabal:
name: ${{ matrix.os }} / ghc-${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
# https://www.haskell.org/ghc/
# https://hackage.haskell.org/package/cabal-install
cabal: ["3.10"]
ghc: ["8.10", "9.0", "9.2", "9.4", "9.6"]
steps:
- name: Clone Repository
uses: actions/[email protected]
- name: Setup Haskell
id: setup-haskell-cabal
uses: haskell/actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Configure and Freeze for Cache
run: |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct -ftools
cabal freeze
- name: Cache ~/.cabal/store
uses: actions/cache@v3
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
- name: Build
run: cabal build '--build-log=logs/$pkgid'
- name: Test
run: cabal test
- name: Upload Build Logs on Failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs-${{ matrix.os }}-ghc${{ matrix.ghc }}
path: logs/
- name: Install
run: cabal install --installdir=artifacts --install-method=copy
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-ghc${{ matrix.ghc }}
path: artifacts/