diff options
author | 2021-02-04 18:13:01 -0800 | |
---|---|---|
committer | 2021-02-04 18:13:32 -0800 | |
commit | e12e403ad215efedce92ddcf1da00ebdc9c87116 (patch) | |
tree | e73911e7d256b8f2ad6898fede515fb630bd0cb5 | |
parent | Merge PR #92 - replace shell scripts with Python scripts (diff) |
CI: fix test step not failing when tests fail
Generating the report in the same step resulted in the report exit code
overriding the exit code of the test runner.
-rw-r--r-- | .github/workflows/lint-test-build-push.yaml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/.github/workflows/lint-test-build-push.yaml b/.github/workflows/lint-test-build-push.yaml index 338e301..a76354b 100644 --- a/.github/workflows/lint-test-build-push.yaml +++ b/.github/workflows/lint-test-build-push.yaml @@ -120,12 +120,15 @@ jobs: run: sudo swapoff -a # Run unittests and generate coverage report in the container - - name: Run unit tests and generate coverage report + - name: Run unit tests id: run_tests run: | echo '::set-output name=started::true' - cmd='coverage run -m unittest; coverage report -m' - docker exec snekbox_dev /bin/bash -c "${cmd}" + docker exec snekbox_dev /bin/bash -c 'coverage run -m unittest' + + - name: Generate coverage report + if: always() && steps.run_tests.outputs.started == 'true' + run: docker exec snekbox_dev /bin/bash -c 'coverage report -m' # Set-up a Python version to process the coverage reports # Note: This step runs even if the test step failed to make |