Skip to content

Commit 5c1bae5

Browse files
committed
CI: caching: do bench & test separately
`cabal v2-build all --enable-tests --enable-benchmarks` inferres 1 version per dep keeping all targets. People (frequently) & CI do `test` & `bench` separately. So `all tests` & `all bench` deps may not end up. Even current code does not match the CI guarantees, as all plugins get `test` separately, so their deps can not match-up. `caching` should not assume guarantees bigger then provided.
1 parent b354202 commit 5c1bae5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/caching.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ on:
4545
- cron: "25 2/8 * * *"
4646

4747
env:
48-
cabalBuild: "v2-build all --enable-tests --enable-benchmarks --keep-going"
48+
cabalBuild: "v2-build all --keep-going"
4949

5050
jobs:
5151

@@ -186,8 +186,10 @@ jobs:
186186
187187
- if: steps.compiled-deps.outputs.cache-hit != 'true'
188188
name: Download all sources
189+
# Downloaded separately, to match the tested work/PR workflow guarantees
189190
run: |
190-
cabal $cabalBuild --only-download
191+
cabal $cabalBuild --enable-benchmarks --only-download
192+
cabal $cabalBuild --enable-tests --only-download
191193
192194
# repeating builds to workaround segfaults in windows and ghc-8.8.4
193195
# This build agenda in not to have successful code,
@@ -197,10 +199,12 @@ jobs:
197199
- if: steps.compiled-deps.outputs.cache-hit != 'true'
198200
name: Build all targets; try 3 times
199201
continue-on-error: true
202+
# Done separately, matching the tested work/PR workflow guarantees
200203
run: |
201-
cabal $cabalBuild || cabal $cabalBuild || cabal $cabalBuild
202204
203205
# Despite the `continue-on-error: true` directive - CI does not ignore the return code of the last step
204206
- name: Workaround to CI platform
205207
run: |
206208
true
209+
cabal $cabalBuild --enable-benchmarks || cabal $cabalBuild --enable-benchmarks || cabal $cabalBuild --enable-benchmarks
210+
cabal $cabalBuild --enable-test || cabal $cabalBuild --enable-test || cabal $cabalBuild --enable-test

0 commit comments

Comments
 (0)