This repository was archived by the owner on Jan 9, 2026. It is now read-only.
Repository navigation
95 lines (78 loc) · 2.27 KB
/
Copy pathcabal-ci.yaml
File metadata and controls
95 lines (78 loc) · 2.27 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
name: Build with Cabal
on:
push:
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc: ['9.6', '9.8', '9.10', '9.12']
cabal: ['latest']
os: ['ubuntu-22.04', 'ubuntu-24.04', 'macOS-latest']
steps:
# Setup
- name: Checkout repository
uses: actions/checkout@v4
- name: Install GHC and Cabal
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Configure project
run: |
cat > cabal.project.local <<EOF
package digraph
documentation: True
benchmarks: True
tests: True
EOF
# Restore Packages from Caches
- name: Restore cache ~/.cabal/packages and ~/.cabal/store
id: deps-cache-restore
uses: actions/cache/restore@v4
with:
path: |
~/.cabal/packages
~/.cabal/store
key: deps-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.local') }}
restore-keys: |
deps-${{ matrix.os }}-${{ matrix.ghc }}-
# Restore dist-newstyle
- name: Cache dist-newstyle
uses: actions/cache@v4
with:
path: |
dist-newstyle
key: dist-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.local') }}
restore-keys: |
dist-${{ matrix.os }}-${{ matrix.ghc }}-
save-always: true
# Build
- name: Update package database
run: cabal update
- name: Configure build
run: |
cabal build all --dry-run
cabal freeze
cat cabal.project.freeze
- name: Show outdated packages
run: cabal outdated
- name: Install build dependencies
run: cabal build --only-dependencies
# Save packages
- name: Save cache for ~/.cabal/packages and ~/.cabal/store
uses: actions/cache/save@v4
if: always()
with:
path: |
~/.cabal/packages
~/.cabal/store
key: ${{ steps.deps-cache-restore.outputs.cache-primary-key }}
- name: Build library
run: cabal build
# Tests
- name: Run Tests
run: cabal test