Skip to content
Merged
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
22 changes: 15 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ jobs:
- build
- discover-tests
- test
- coverage
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
Expand All @@ -484,14 +485,17 @@ jobs:
with:
path: all-test-results

# Dependabot runs get a read-only token whatever the job asks for, so the
# check run and PR comment this writes can't be published there. The
# status step below still fails the job when a test did.
# Dependabot and fork PR runs get a read-only token whatever the job
# asks for, so the check run and PR comment this writes can't be
# published there. The status step below still fails the job when a
# test did.
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0
if: >-
${{ always() && needs.discover-tests.outputs.has_tests == 'true' &&
github.actor != 'dependabot[bot]' }}
github.actor != 'dependabot[bot]' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository) }}
with:
files: |
all-test-results/**/*.trx
Expand All @@ -508,6 +512,7 @@ jobs:
BUILD_STATUS: ${{ needs.build.result }}
DISCOVER_STATUS: ${{ needs.discover-tests.result }}
TEST_STATUS: ${{ needs.test.result }}
COVERAGE_STATUS: ${{ needs.coverage.result }}
run: |
{
echo "## Test Execution Summary"
Expand All @@ -516,6 +521,7 @@ jobs:
echo "- **Build:** ${BUILD_STATUS}"
echo "- **Discovered Tests:** ${DISCOVER_STATUS}"
echo "- **Test Matrix:** ${TEST_STATUS}"
echo "- **Coverage (60% gate):** ${COVERAGE_STATUS}"
echo ""
echo "### Artifacts"
echo "- Test and coverage reports are in Actions artifacts"
Expand All @@ -528,11 +534,13 @@ jobs:
} >> "$GITHUB_STEP_SUMMARY"

# This job is the required status check that stands in for the
# dynamically named "Tests: …" matrix jobs, so it must fail when
# they do. A skipped test matrix (no test projects) still passes.
# dynamically named "Tests: …" matrix jobs and the 60% coverage
# gate, so it must fail when any of them does. A skipped test
# matrix (no test projects) still passes.
if [[ "$BUILD_STATUS" =~ ^(failure|cancelled)$ \
|| "$DISCOVER_STATUS" =~ ^(failure|cancelled)$ \
|| "$TEST_STATUS" =~ ^(failure|cancelled)$ ]]; then
|| "$TEST_STATUS" =~ ^(failure|cancelled)$ \
|| "$COVERAGE_STATUS" =~ ^(failure|cancelled)$ ]]; then
echo "❌ **Overall Status:** FAILED" >> "$GITHUB_STEP_SUMMARY"
exit 1
else
Expand Down
Loading