Skip to content

Commit 0d80d52

Browse files
geekosaurMikolaj
authored andcommitted
keep running tests even if earlier ones failed
Matt Pickering says we should always run all tests. This requires a loop to ensure we still fail if any test does.
1 parent ba507b1 commit 0d80d52

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

.github/workflows/validate.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -236,29 +236,24 @@ jobs:
236236
name: cabal-${{ runner.os }}-${{ env.CABAL_ARCH }}
237237
path: ${{ env.CABAL_EXEC_TAR }}
238238

239-
- name: Validate lib-tests
239+
- name: Validate tests
240240
env:
241241
# `rawSystemStdInOut reports text decoding errors`
242242
# test does not find ghc without the full path in windows
243243
GHCPATH: ${{ steps.setup-haskell.outputs.ghc-exe }}
244-
run: sh validate.sh $FLAGS -s lib-tests
245-
246-
- name: Validate lib-suite
247-
run: sh validate.sh $FLAGS -s lib-suite
248-
249-
- name: Validate cli-tests
250-
run: sh validate.sh $FLAGS -s cli-tests
251-
252-
- name: Validate cli-suite
253-
run: sh validate.sh $FLAGS -s cli-suite
254-
255-
- name: Validate solver-benchmarks-tests
256-
if: matrix.ghc == env.GHC_FOR_SOLVER_BENCHMARKS
257-
run: sh validate.sh $FLAGS -s solver-benchmarks-tests
258-
259-
- name: Validate solver-benchmarks-run
260-
if: matrix.ghc == env.GHC_FOR_SOLVER_BENCHMARKS
261-
run: sh validate.sh $FLAGS -s solver-benchmarks-run
244+
run: |
245+
set +e
246+
rc=0
247+
tests="lib-tests lib-suite cli-tests cli-suite"
248+
if [ "${{ matrix.ghc }}" = "${{ env.GHC_FOR_SOLVER_BENCHMARKS }}" ]; then
249+
tests="$tests solver-benchmarks-tests solver-benchmarks-run"
250+
fi
251+
for test in $tests; do
252+
echo Validate "$test"
253+
sh validate.sh $FLAGS -s "$test" || rc=1
254+
echo End "$test"
255+
done
256+
exit $rc
262257
263258
validate-old-ghcs:
264259
name: Validate old ghcs ${{ matrix.extra-ghc }}
@@ -312,11 +307,13 @@ jobs:
312307
restore-keys: ${{ runner.os }}-${{ env.GHC_FOR_RELEASE }}-
313308

314309
- name: Validate build
310+
id: build
315311
run: sh validate.sh ${{ env.COMMON_FLAGS }} -s build
316312

317313
- name: "Validate lib-suite-extras --extra-hc ghc-${{ matrix.extra-ghc }}"
318314
env:
319315
EXTRA_GHC: ghc-${{ matrix.extra-ghc }}
316+
continue-on-error: true
320317
run: sh validate.sh ${{ env.COMMON_FLAGS }} --lib-only -s lib-suite-extras --extra-hc "${{ env.EXTRA_GHC }}"
321318

322319
build-alpine:

0 commit comments

Comments
 (0)