-
Notifications
You must be signed in to change notification settings - Fork 52
57 lines (47 loc) · 1.45 KB
/
haskell.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: Haskell
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup
# Default options, written out for clarity:
with:
ghc-version: latest
cabal-update: true
- name: Configure build
run: |
cabal configure --enable-tests --enable-benchmarks --write-ghc-environment-files=always
cabal build --dry-run
# The latter creates the build plan in dist-newstyle/cache/plan.json
- name: Restore cached dependencies
uses: actions/cache/restore@v3
id: cache
env:
cache-name: cache-cabal
with:
path: ~/.cabal
key: ${{ runner.os }}-${{ env.cache-name }}-ghc-${{ steps.setup.outputs.ghc-version}}-plan-${{ hashFiles('dist-newstyle/cache/plan.json') }}
restore-keys: ${{ runner.os }}-${{ env.cache-name }}-ghc-${{ steps.setup.outputs.ghc-version}}-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
cabal build --only-dependencies
- name: Cache dependencies
uses: actions/cache/save@v3
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ~/.cabal
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: Build
run: |
cabal build all
- name: Test
run: |
cabal test all