1
1
name : CI
2
- on : pull_request
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ # PRs can only use caches from their target branch. We therefore need to
7
+ # make sure we run on 'master' too.
8
+ - master
9
+ pull_request :
3
10
4
11
concurrency :
5
12
group : ${{ github.head_ref }}
31
38
ghc : 9.0.2
32
39
33
40
steps :
34
- - uses : actions/checkout@v2
35
- - uses : haskell/actions/setup@v1
41
+ - uses : actions/checkout@v3
42
+ - uses : haskell/actions/setup@v2
36
43
id : setup-haskell
37
44
with :
38
45
ghc-version : ${{ matrix.ghc }}
51
58
cp .ci/stack-${{ matrix.ghc }}.yaml stack.yaml
52
59
53
60
- name : Cache
61
+ # Note: we're stuck on v1 because of:
62
+ #
63
+ # https://github.com/actions/cache/issues/666
54
64
uses : actions/cache@v1
55
65
with :
56
66
path : |
@@ -124,7 +134,7 @@ jobs:
124
134
125
135
steps :
126
136
- name : Checkout
127
- uses : actions/checkout@v2
137
+ uses : actions/checkout@v3
128
138
with :
129
139
submodules : true
130
140
ref : ${{ github.event.pull_request.head.ref }}
@@ -140,7 +150,7 @@ jobs:
140
150
mv cabal.project.freeze frozen
141
151
142
152
- name : Restore Cache
143
- uses : actions/cache@v2
153
+ uses : actions/cache@v3
144
154
with :
145
155
path : |
146
156
dist-newstyle
@@ -168,3 +178,44 @@ jobs:
168
178
169
179
- name : Testsuite (SystemVerilog)
170
180
run : cabal v2-run clash-testsuite -- -j$THREADS --hide-successes -p .SystemVerilog --no-modelsim --no-vivado
181
+
182
+
183
+ all :
184
+ name : All jobs finished
185
+ if : always()
186
+ needs : [
187
+ build_mac_windows,
188
+ build_and_test,
189
+ ]
190
+ runs-on : ubuntu-22.04
191
+ steps :
192
+ - name : Checkout
193
+ uses : actions/checkout@v3
194
+
195
+ - name : Check dependencies for failures
196
+ run : |
197
+ # Test all dependencies for success/failure
198
+ set -x
199
+ success="${{ contains(needs.*.result, 'success') }}"
200
+ fail="${{ contains(needs.*.result, 'failure') }}"
201
+ set +x
202
+
203
+ # Test whether success/fail variables contain sane values
204
+ if [[ "${success}" != "true" && "${success}" != "false" ]]; then exit 1; fi
205
+ if [[ "${fail}" != "true" && "${fail}" != "false" ]]; then exit 1; fi
206
+
207
+ # We want to fail if one or more dependencies fail. For safety, we introduce
208
+ # a second check: if no dependencies succeeded something weird is going on.
209
+ if [[ "${fail}" == "true" || "${success}" == "false" ]]; then
210
+ echo "One or more dependency failed, or no dependency succeeded."
211
+ exit 1
212
+ fi
213
+
214
+ - name : Install dependencies
215
+ run : |
216
+ sudo apt-get update
217
+ sudo apt-get -y install python3-yaml
218
+
219
+ - name : Check that the 'all' job depends on all other jobs
220
+ run : |
221
+ .ci/all_check.py
0 commit comments