diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27d99d1..af50b92 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,20 +100,29 @@ jobs: run: sudo chmod -R 744 .dependencies - name: Build + id: tests_run + continue-on-error: true run: | mkdir build cd build cmake .. -G Ninja ninja test_coverage_report - - name: Add PR Comment - if: ${{ github.event.pull_request }} - uses: mshick/add-pr-comment@v2 - with: - message-path: build/Summary.txt - name: Upload artifacts uses: actions/upload-artifact@v3.1.1 with: name: Coverage path: build/Coverage + + - name: Report failure + if: steps.tests_run.outcome == 'failure' + run: echo ${{ steps.tests_run.outcome }} && test -n "" + + # We don't PR comment if the tests failed, because + # the report isn't a complete picture... + - name: Add PR Comment + if: ${{ github.event.pull_request }} + uses: mshick/add-pr-comment@v2 + with: + message-path: build/Summary.txt diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a24ba5e..a081796 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -55,8 +55,8 @@ if(GCOV_ENABLE) COMMAND tar -zcvf Coverage.tar.gz Coverage # Cheat and compare a file to itself to check for existence. File-Not-Found is a failure # code. - COMMAND ${PROJECT_SOURCE_DIR}/utils/gcovr.py -r . -e '../../tests' -e '../../lib/Catch2' | tee - Summary.txt + COMMAND ${PROJECT_SOURCE_DIR}/utils/gcovr.py -r ${CMAKE_SOURCE_DIR} -e 'tests' -e 'lib/Catch2' | + tee Summary.txt COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/.ctest-finished ${PROJECT_BINARY_DIR}/.ctest-finished BYPRODUCTS ${PROJECT_BINARY_DIR}/Summary.txt ${PROJECT_BINARY_DIR}/Coverage.tar.gz