This repository has been archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (47 loc) · 1.5 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
name: Continuous Integration
on: [push, pull_request]
jobs:
continuous-integration:
strategy:
matrix:
ghc-version:
- "9.0.2"
- "9.2.8"
- "9.4.5"
- "9.6.4"
- "9.8.2"
runs-on: ubuntu-latest
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.10.3.0'
- name: Generate freeze file
run: |
cabal update
cabal configure --disable-optimization
cabal freeze
# 'cabal freeze' will use the nearest index state which might not be exactly equal
# to the index state specified in 'cabal.project'
sed '/^index-state: /d' cabal.project.freeze > dependencies-versions
- name: Cache cabal work
uses: actions/cache@v4
with:
path: |
dist-newstyle
${{ steps.setup-haskell.outputs.cabal-store }}
# We are using the hash of 'cabal.project.local' so that different levels
# of optimizations are cached separately
key: ${{ runner.os }}-${{ hashFiles('dependencies-versions', 'cabal.project', 'cabal.project.local') }}-cabal-install
- name: Build dependencies only
run: |
cabal build --enable-tests --only-dependencies
- name: Build this package
run: |
cabal build --enable-tests
- name: Run tests
run: |
cabal test