Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ concurrency:

permissions:
contents: read
checks: write

jobs:
test:
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions tests/bash/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
Loading