Skip to content

Commit 3d4487a

Browse files
committed
ci: split test-reports off from CI to account for forks
1 parent c32cfe9 commit 3d4487a

2 files changed

Lines changed: 32 additions & 45 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ on:
1515

1616
permissions:
1717
contents: read
18-
checks: write
19-
actions: read
2018

2119
concurrency:
2220
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -322,7 +320,7 @@ jobs:
322320
cd ../../../; make test
323321
- name: Upload Tests
324322
uses: actions/upload-artifact@v7
325-
if: success() || failure()
323+
if: ${{ !cancelled() }}
326324
with:
327325
name: Trick_${{ matrix.cfg.os }}${{ matrix.cfg.tag }}
328326
path: trick_test/*.xml
@@ -369,7 +367,7 @@ jobs:
369367
cd ../../../; make test
370368
- name: Upload Tests
371369
uses: actions/upload-artifact@v7
372-
if: success() || failure()
370+
if: ${{ !cancelled() }}
373371
with:
374372
name: Trick_macos
375373
path: trick_test/*.xml
@@ -484,44 +482,3 @@ jobs:
484482
with:
485483
github-token: ${{ secrets.GITHUB_TOKEN }}
486484
path-to-lcov: "./coverage.info"
487-
488-
# ──────────────────────────────────────────────────────────────────────────
489-
# Stage 3: Report results
490-
# ──────────────────────────────────────────────────────────────────────────
491-
492-
report-linux:
493-
name: Report (${{ matrix.cfg.os }} ${{ matrix.cfg.tag }})
494-
needs: [test-linux]
495-
if: always()
496-
runs-on: ubuntu-latest
497-
strategy:
498-
fail-fast: false
499-
matrix:
500-
cfg:
501-
- { os: ubuntu, tag: 24.04 }
502-
- { os: oraclelinux, tag: 8 }
503-
- { os: rockylinux, tag: 8 }
504-
- { os: rockylinux, tag: 9 }
505-
- { os: rockylinux, tag: 10 }
506-
steps:
507-
- name: Publish Test Report
508-
uses: dorny/test-reporter@v2
509-
with:
510-
artifact: Trick_${{ matrix.cfg.os }}${{ matrix.cfg.tag }}
511-
name: Results_Trick_${{ matrix.cfg.os }}${{ matrix.cfg.tag }}
512-
path: "*.xml"
513-
reporter: java-junit
514-
515-
report-macos:
516-
name: Report (macOS)
517-
needs: [test-macos]
518-
if: always()
519-
runs-on: ubuntu-latest
520-
steps:
521-
- name: Publish Test Report
522-
uses: dorny/test-reporter@v2
523-
with:
524-
artifact: Trick_macos
525-
name: Results_Trick_macos
526-
path: "*.xml"
527-
reporter: java-junit

.github/workflows/test-report.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test Report
2+
3+
on:
4+
workflow_run:
5+
workflows: [CI]
6+
types: [completed]
7+
8+
permissions:
9+
contents: read
10+
actions: read
11+
checks: write
12+
13+
jobs:
14+
report:
15+
name: Publish Test Results
16+
runs-on: ubuntu-latest
17+
if: ${{ github.event.workflow_run.conclusion != 'skipped' }}
18+
steps:
19+
- name: Publish Test Report
20+
uses: dorny/test-reporter@v3
21+
with:
22+
# Matches all Trick_* artifacts uploaded by the CI workflow.
23+
# The capture group becomes $1 in the report name.
24+
artifact: /Trick_(.*)/
25+
name: Test Results ($1)
26+
path: "*.xml"
27+
reporter: java-junit
28+
fail-on-error: false
29+
fail-on-empty: false
30+
max-annotations: 50

0 commit comments

Comments
 (0)