diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d574a73..3aed1b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,6 @@ concurrency: permissions: contents: read - checks: write jobs: test: @@ -48,13 +47,12 @@ jobs: ./tests/bash/run-tests.sh --ci - name: Publish test results - uses: mikepenz/action-junit-report@4a26df3e2ae132254ba12a53f65a388d0961e786 # v6.7.0 + # Pre-release trial of DevSecNinja/.github#604; pin a release before merging. + uses: DevSecNinja/.github/actions/test-report@b558c78a4d9e175874ebf5bf953e60da27d5215e # test-report trial if: always() with: - report_paths: "tests/bash/test-results.xml" - check_name: Bats Test Results - detailed_summary: true - include_passed: true + paths: tests/bash/test-results.xml + title: Bats tests - name: Upload test results artifact uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 diff --git a/tests/bash/run-tests.sh b/tests/bash/run-tests.sh index 768d233..b2de8fa 100755 --- a/tests/bash/run-tests.sh +++ b/tests/bash/run-tests.sh @@ -173,8 +173,9 @@ if [ "${CI_MODE}" = true ]; then # Run with pretty terminal output and a separate JUnit report file # --report-formatter writes JUnit XML to --output directory REPORT_DIR="$(dirname "${OUTPUT_FILE}")" - bats --formatter tap --report-formatter junit --output "${REPORT_DIR}" "${TEST_FILES[@]}" - EXIT_CODE=$? + # set -e would exit on failing tests before the report is renamed. + EXIT_CODE=0 + bats --formatter tap --report-formatter junit --output "${REPORT_DIR}" "${TEST_FILES[@]}" || EXIT_CODE=$? # Rename the report file to the expected output filename if [ -f "${REPORT_DIR}/report.xml" ]; then mv "${REPORT_DIR}/report.xml" "${OUTPUT_FILE}"