Repository navigation
141 lines (121 loc) · 4.21 KB
/
Copy pathstack.yml
File metadata and controls
141 lines (121 loc) · 4.21 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: stack
on:
push:
branches:
- master
pull_request:
branches:
- master
defaults:
run:
shell: bash
jobs:
stack:
name: Stack ${{ matrix.ghc }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
ghc: 9.10.1
resolver: nightly-2025-02-18
- os: ubuntu-latest
ghc: 9.8.4
resolver: lts-23.9
- os: ubuntu-latest
ghc: 9.6.6
resolver: lts-22.43
- os: ubuntu-latest
ghc: 9.4.8
resolver: lts-21.25
- os: ubuntu-latest
ghc: 9.2.8
resolver: lts-20.26
- os: ubuntu-latest
ghc: 9.0.2
resolver: lts-19.33
- os: ubuntu-latest
ghc: 8.10.7
resolver: lts-18.28
- os: ubuntu-latest
ghc: 8.8.4
resolver: lts-16.31
- os: ubuntu-latest
ghc: 8.6.5
resolver: lts-14.27
- os: ubuntu-latest
ghc: 8.4.4
resolver: lts-12.26
env:
stack: 'stack --system-ghc --no-install-ghc'
steps:
- uses: actions/checkout@v4
- name: Install GHC and stack with haskell-actions/setup
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
enable-stack: true
cabal-update: false
- name: Create stack.yaml
run: |
cat > stack.yaml <<EOF
resolver: ${{ matrix.resolver }}
compiler: ghc-${{ matrix.ghc }}
packages: [.]
EOF
# According to https://github.com/commercialhaskell/stack/issues/5754#issuecomment-1696156869
# not all of ~/.stack should be cached,
# only the index (pantry) and the dependencies (sqlite3+snapshots).
## Pantry
########################################################################
- name: Restore cached stack pantry
uses: actions/cache/restore@v4
id: cache-pantry
with:
path: ${{ steps.setup.outputs.stack-root }}/pantry
key: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-pantry-resolver-${{ matrix.resolver }}
# No fall-back keys here!
- name: Stack update
if: steps.cache-pantry.outputs.cache-hit != 'true'
run: ${{ env.stack }} update
- name: Cache stack pantry
if: steps.cache-pantry.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ steps.setup.outputs.stack-root }}/pantry
key: ${{ steps.cache-pantry.outputs.cache-primary-key }}
## Dependencies
########################################################################
- name: Stack build plan
run: ${{ env.stack }} test --dry-run > '.build-plan.txt'
- name: Restore cached dependencies
uses: actions/cache/restore@v4
id: cache-deps
with:
path: |
${{ steps.setup.outputs.stack-root }}/stack.sqlite3
${{ steps.setup.outputs.stack-root }}/snapshots
key: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}-resolver-${{ matrix.resolver }}-plan-${{ hashfiles('.build-plan.txt') }}
restore-keys: |
${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}-resolver-${{ matrix.resolver }}-
${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}-
- name: Build dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: ${{ env.stack }} test --dependencies-only
- name: Cache dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
${{ steps.setup.outputs.stack-root }}/stack.sqlite3
${{ steps.setup.outputs.stack-root }}/snapshots
key: ${{ steps.cache-deps.outputs.cache-primary-key }}
## Build and test STMonadTrans
########################################################################
- name: Build w/ tests
run: ${{ env.stack }} test --no-run-tests
- name: Run tests
run: ${{ env.stack }} test