Skip to content

Commit f4df9e0

Browse files
committed
Merge workflows for collecting test results
1 parent 3c2bc3d commit f4df9e0

File tree

2 files changed

+25
-33
lines changed

2 files changed

+25
-33
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,29 @@ jobs:
217217
name: ${{ env.ARTIFACT_NAME }}
218218
path: ${{ env.PRINTAPI_EXEC_TAR }}
219219

220+
collect-test-results:
221+
runs-on: ubuntu-latest
222+
steps:
223+
- name: Install junitparser
224+
run: |
225+
pip install junitparser==3.2.0
226+
- name: Download Test Report
227+
uses: actions/download-artifact@v4
228+
with:
229+
pattern: report-*
230+
merge-multiple: true
231+
workflow: ${{ github.event.workflow.id }}
232+
run-id: ${{ github.event.workflow_run.id }}
233+
github-token: ${{ secrets.GH_PAT }} # token with actions:read permissions on target repo
234+
- name: Merge XML files
235+
run: |
236+
junitparser merge --glob *.xml final-report.xml
237+
- name: Publish Test Report
238+
uses: mikepenz/action-junit-report@v3
239+
with:
240+
commit: ${{github.event.workflow_run.head_sha}}
241+
report_paths: 'final-report.xml'
242+
220243
prerelease-head:
221244
name: Create a GitHub prerelease with the binary artifacts
222245
runs-on: ubuntu-latest
@@ -233,5 +256,6 @@ jobs:
233256
uses: softprops/action-gh-release@v2
234257
if: startsWith(github.ref, 'refs/tags/')
235258
with:
236-
draft: true
259+
prerelease: true
237260
files: ./out/*
261+
tag_name: print-api-head

.github/workflows/test-reports.yml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +0,0 @@
1-
name: Test Reports
2-
on:
3-
workflow_run:
4-
workflows: [ "Tests Pipeline" ]
5-
types: [ completed ]
6-
7-
permissions:
8-
checks: write
9-
10-
jobs:
11-
checks:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Install juitparser
15-
run: |
16-
pip install junitparser==3.2.0
17-
- name: Download Test Report
18-
uses: actions/download-artifact@v4
19-
with:
20-
pattern: report-*
21-
merge-multiple: true
22-
workflow: ${{ github.event.workflow.id }}
23-
run-id: ${{ github.event.workflow_run.id }}
24-
github-token: ${{ secrets.GH_PAT }} # token with actions:read permissions on target repo
25-
- name: Merge XML files
26-
run: |
27-
junitparser merge --glob *.xml final-report.xml
28-
- name: Publish Test Report
29-
uses: mikepenz/action-junit-report@v3
30-
with:
31-
commit: ${{github.event.workflow_run.head_sha}}
32-
report_paths: 'final-report.xml'

0 commit comments

Comments
 (0)