Skip to content

Commit

Permalink
Merge pull request #24 from jberthold/ci-improve-run-failed-tests-step
Browse files Browse the repository at this point in the history
CI: Run "Run failed tests"-step only if "Run tests"-step failed
  • Loading branch information
runeksvendsen authored Jan 12, 2025
2 parents fbf6187 + eb603f6 commit 58b5a6d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/cabal-in-nix-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ jobs:
# The condition "other_test_suites_did_not_fail" is tested by asserting that no log files exist that fit the "*-test-fail.log" pattern while excluding the log file of the "testmthread" test suite (testmthread-test-fail.log).
# TODO: Revert this change once that issue is fixed.
- name: Run tests
id: run_tests
run: |
mkdir ci-logs
nix-shell --argstr ghcVersion ${{ matrix.ghc }} --argstr ccVersion ${{ matrix.cc }} --run '(cabal test --test-log="$(pwd)/ci-logs/\$test-suite-test-\$result.log" || grep "testmthread: Contains an unsupported closure type (whose implementation is missing)" ci-logs/testmthread-test-fail.log) && (! find ci-logs ! -name testmthread-test-fail.log -name "*-test-fail.log"|grep .)'
- name: Print output of failed tests
if: failure()
if: ${{ failure() && steps.run_tests.conclusion == 'failure' }}
run: nix-shell --argstr ghcVersion ${{ matrix.ghc }} --argstr ccVersion ${{ matrix.cc }} --run 'tail -v -n +1 ci-logs/*-test-fail.log'

0 comments on commit 58b5a6d

Please sign in to comment.