From e6ded73b9701ecd032493ae4e854dc9ab991aa91 Mon Sep 17 00:00:00 2001 From: bruno Date: Mon, 18 Mar 2024 12:11:50 +0100 Subject: [PATCH] provide results to download on failure Search assert check, require in results file and echo if it appears --- .github/workflows/run-unit-tests.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index 91fc32131..5e6cf9299 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -74,6 +74,31 @@ jobs: run: | build/${{ matrix.build-setup.cmake-preset }}/bin/KNITest \ --gtest_output="xml:reports/report-kni.xml" + - name: Check assertions + if: success() || failure() + run: | + if (grep -q -E -r "Assert failed in file|Require failed in file|Ensure failed in file|Check failed in file" \ + test/KNITest/results/ \ + test/Norm/results/ \ + test/Learning/results/ \ + test/Norm/results/ \ + test/Parallel/results/ \ + test/Parallel-mpi/results/); then + echo "::error::At least one test binary has failed with an assertion (assert, check, require, ensure..). Check result files available for download as artifacts." + fi + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v3 + with: + name: unit-tests-results-${{ matrix.build-setup.os }} + retention-days: 7 + path: |- + test/KNITest/results/ + test/Norm/results/ + test/Learning/results/ + test/Norm/results/ + test/Parallel/results/ + test/Parallel-mpi/results/ - name: Create Unit Test Reports Dashboards uses: phoenix-actions/test-reporting@v12 if: success() || failure()