21
21
meta :
22
22
name : Meta checks
23
23
runs-on : ubuntu-latest
24
- <<<<<<< HEAD
25
- # This job is not run in a container, any recent GHC should be fine
26
- steps :
27
- - name : Set PATH
28
- # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
29
- =======
30
24
env :
31
25
cabal_build : >-
32
26
cabal build --builddir=dist-newstyle-meta --project-file=cabal.meta.project
@@ -42,50 +36,42 @@ jobs:
42
36
ghcup install ghc $GHC_FOR_QUICK_JOBS
43
37
ghcup set ghc $GHC_FOR_QUICK_JOBS
44
38
- name : Haskell versions
45
- >>>>>>> 305033b30 (ci: Fix quick-jobs GHC version to 9.6 (#10026))
46
- run : |
47
- echo "$HOME/.cabal/bin" >> $GITHUB_PATH
48
- - uses : actions/cache@v3
49
- with :
50
- path : ~/.cabal/store
51
- key : linux-store-meta
52
- # See https://github.com/haskell/cabal/pull/8739
53
- - name : Sudo chmod to permit ghcup to update its cache
54
39
run : |
55
- if [[ "${{ runner.os }}" == "Linux" ]]; then
56
- sudo ls -lah /usr/local/.ghcup/cache
57
- sudo mkdir -p /usr/local/.ghcup/cache
58
- sudo ls -lah /usr/local/.ghcup/cache
59
- sudo chown -R $USER /usr/local/.ghcup
60
- sudo chmod -R 777 /usr/local/.ghcup
61
- fi
62
- - name : ghcup
63
- run : |
64
- ghcup --version
65
- ghcup config set cache true
66
- ghcup install ghc recommended
67
- ghcup set ghc recommended
40
+ ghc --version
41
+ cabal --version
68
42
- name : Update Hackage index
69
43
run : cabal v2-update
70
- - name : Install alex
71
- run : cabal v2-install alex --constraint='alex ==3.2.7.3'
72
44
- uses : actions/checkout@v4
45
+ - name : Generate build plan for correct cache key
46
+ run : ${{ env.cabal_build }} --dry-run
47
+ - name : Restore cached dependencies
48
+ uses : actions/cache/restore@v4
49
+ id : cache
50
+ with :
51
+ path : ~/.local/state/cabal
52
+ key : linux-store-meta-${{ hashfiles('dist-newstyle-meta/cache/plan.json') }}
53
+ restore-keys : linux-store-meta-
54
+ - name : Build tools
55
+ run : ${{ env.cabal_build }}
73
56
- name : Regenerate files
74
57
run : |
75
- make -B lexer
76
58
make -B spdx
77
59
make -B templates
78
60
- name : Check that diff is clean
79
61
run : |
80
62
git status > /dev/null
81
63
git diff-files -p --exit-code
64
+ - name : Cache dependencies
65
+ uses : actions/cache/save@v4
66
+ if : always() && steps.cache.outputs.cache-hit != 'true'
67
+ with :
68
+ path : ~/.local/state/cabal
69
+ key : ${{ steps.cache.outputs.cache-primary-key }}
70
+
82
71
doctest :
83
72
name : Doctest Cabal
84
73
runs-on : ubuntu-latest
85
74
steps :
86
- <<<<<<< HEAD
87
- - name : Set PATH
88
- =======
89
75
- name : ghcup
90
76
run : |
91
77
ghcup --version
@@ -102,110 +88,86 @@ jobs:
102
88
# Updating it with each run would be an alternative, but we a short of cache space,
103
89
# and this would generate too many new caches.
104
90
- name : Use date as cache key
105
- >>>>>>> 305033b30 (ci: Fix quick-jobs GHC version to 9.6 (#10026))
106
91
run : |
107
- echo "$HOME/.cabal/bin" >> $GITHUB_PATH
108
- - uses : actions/cache@v3
92
+ echo "DATE=$(date +'%Y-%m-%d')" >> "${GITHUB_ENV}"
93
+ - name : Restore cached dependencies
94
+ uses : actions/cache/restore@v4
95
+ id : cache
109
96
with :
110
- path : ~/.cabal/store
111
- key : linux-store-doctest
112
- # See https://github.com/haskell/cabal/pull/8739
113
- - name : Sudo chmod to permit ghcup to update its cache
114
- run : |
115
- if [[ "${{ runner.os }}" == "Linux" ]]; then
116
- sudo ls -lah /usr/local/.ghcup/cache
117
- sudo mkdir -p /usr/local/.ghcup/cache
118
- sudo ls -lah /usr/local/.ghcup/cache
119
- sudo chown -R $USER /usr/local/.ghcup
120
- sudo chmod -R 777 /usr/local/.ghcup
121
- fi
122
- - name : ghcup
123
- run : |
124
- ghcup --version
125
- ghcup config set cache true
126
- ghcup install ghc --set recommended
127
- ghcup install cabal --set latest
97
+ path : ~/.local/state/cabal
98
+ key : linux-store-doctest-${{ env.DATE }}
99
+ restore-keys : linux-store-doctest
128
100
- name : Update Hackage index
129
101
run : cabal v2-update
130
102
- uses : actions/checkout@v4
131
103
- name : Install doctest
132
104
run : make doctest-install
133
105
- name : Doctest
134
106
run : make doctest
107
+ - name : Cache dependencies
108
+ if : always() && steps.cache.outputs.cache-hit != 'true'
109
+ uses : actions/cache/save@v4
110
+ with :
111
+ path : ~/.local/state/cabal
112
+ key : ${{ steps.cache.outputs.cache-primary-key }}
113
+
135
114
buildinfo :
136
115
name : Check Field Syntax Reference
137
116
runs-on : ubuntu-latest
117
+ env :
118
+ cabal_build : cabal build buildinfo-reference-generator
138
119
steps :
139
- <<<<<<< HEAD
140
- - name : Set PATH
141
- run : |
142
- echo "$HOME/.cabal/bin" >> $GITHUB_PATH
143
- - uses : actions/cache@v3
144
- with :
145
- path : ~/.cabal/store
146
- key : linux-store-buildinfo-doc-diff
147
- # See https://github.com/haskell/cabal/pull/8739
148
- - name : Sudo chmod to permit ghcup to update its cache
149
- run : |
150
- if [[ "${{ runner.os }}" == "Linux" ]]; then
151
- sudo ls -lah /usr/local/.ghcup/cache
152
- sudo mkdir -p /usr/local/.ghcup/cache
153
- sudo ls -lah /usr/local/.ghcup/cache
154
- sudo chown -R $USER /usr/local/.ghcup
155
- sudo chmod -R 777 /usr/local/.ghcup
156
- fi
157
- =======
158
- >>>>>>> 305033b30 (ci: Fix quick-jobs GHC version to 9.6 (#10026))
159
120
- name : ghcup
160
121
run : |
161
122
ghcup --version
162
123
ghcup config set cache true
163
- <<<<<<< HEAD
164
- ghcup install ghc --set recommended
165
- ghcup install cabal --set latest
166
- =======
167
124
ghcup install ghc $GHC_FOR_QUICK_JOBS
168
125
ghcup set ghc $GHC_FOR_QUICK_JOBS
169
126
- name : Haskell versions
170
127
run : |
171
128
ghc --version
172
129
cabal --version
173
- >>>>>>> 305033b30 (ci: Fix quick-jobs GHC version to 9.6 (#10026))
174
130
- name : Update Hackage index
175
131
run : cabal v2-update
176
132
- uses : actions/checkout@v4
133
+ - name : Generate build plan for correct cache key
134
+ run : ${{ env.cabal_build }} --dry-run
135
+ - name : Restore cached dependencies
136
+ uses : actions/cache/restore@v4
137
+ id : cache
138
+ with :
139
+ path : ~/.local/state/cabal
140
+ key : linux-store-buildinfo-doc-diff-${{ hashfiles('dist-newstyle/cache/plan.json') }}
141
+ restore-keys : linux-store-buildinfo-doc-diff
142
+ - name : Build buildinfo-reference-generator
143
+ run : ${{ env.cabal_build }}
177
144
- name : Are buildinfo docs up to date?
178
145
run : make doc/buildinfo-fields-reference.rst
146
+ - name : Cache dependencies
147
+ uses : actions/cache/save@v4
148
+ if : always() && steps.cache.outputs.cache-hit != 'true'
149
+ with :
150
+ path : ~/.local/state/cabal
151
+ key : ${{ steps.cache.outputs.cache-primary-key }}
152
+
179
153
release-project :
180
154
name : Check Release Project
181
155
runs-on : ubuntu-latest
182
156
steps :
183
- <<<<<<< HEAD
184
- - name : Set PATH
185
- run : |
186
- echo "$HOME/.cabal/bin" >> $GITHUB_PATH
187
- =======
188
- >>>>>>> 305033b30 (ci: Fix quick-jobs GHC version to 9.6 (#10026))
189
157
- name : ghcup
190
158
run : |
191
159
ghcup --version
192
160
ghcup config set cache true
193
- <<<<<<< HEAD
194
- ghcup install ghc --set recommended
195
- ghcup install cabal --set latest
196
- =======
197
161
ghcup install ghc $GHC_FOR_QUICK_JOBS
198
162
ghcup set ghc $GHC_FOR_QUICK_JOBS
199
163
- name : Haskell versions
200
164
run : |
201
165
ghc --version
202
166
cabal --version
203
- >>>>>>> 305033b30 (ci: Fix quick-jobs GHC version to 9.6 (#10026))
204
167
- name : Update Hackage Index
205
168
run : cabal v2-update
206
169
- uses : actions/checkout@v4
207
170
- name : Check Release with Pinned Hackage
208
- run : cabal build all --dry-run --project-file=cabal.project. release
171
+ run : cabal build all --dry-run --project-file=cabal.release.project
209
172
- name : Check Release with Latest Hackage
210
- run : cabal build all --dry-run --project-file=cabal.project.release --index-state="hackage.haskell.org HEAD"
211
-
173
+ run : cabal build all --dry-run --project-file=cabal.release.project --index-state="hackage.haskell.org HEAD"
0 commit comments