Skip to content

Commit

Permalink
ci: Improve display of test results using JUnit XML
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Aug 30, 2023
1 parent ffc617f commit f3c7ee8
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ jobs:

- name: "Test"
if: matrix.crosscompile != true
run: ctest --timeout 45 ${{ matrix.ctest_args }}
run: ctest --timeout 45 --output-junit junit.xml ${{ matrix.ctest_args }}
working-directory: build
env:
# Render analyzer waveform tests to an offscreen buffer
Expand All @@ -331,6 +331,13 @@ jobs:
CTEST_PARALLEL_LEVEL: 1
CTEST_OUTPUT_ON_FAILURE: 1

- name: "Upload Test Results"
if: always() && matrix.crosscompile != true
uses: actions/upload-artifact@v3
with:
name: Test Results for ${{ matrix.name}}
path: build/junit.xml

- name: Benchmark
if: matrix.crosscompile != true
run: cmake --build . --target mixxx-benchmark --config RelWithDebInfo
Expand Down Expand Up @@ -536,3 +543,13 @@ jobs:
run: curl -X POST -d '{}' ${{ env.NETLIFY_BUILD_HOOK }}
env:
NETLIFY_BUILD_HOOK: ${{ secrets.NETLIFY_BUILD_HOOK }}

upload_event_file:
name: "Upload Event File"
runs-on: ubuntu-latest
steps:
- name: Upload Event File
uses: actions/upload-artifact@v3
with:
name: Event File
path: ${{ github.event_path }}
34 changes: 34 additions & 0 deletions .github/workflows/test-results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Test Results"

on:
workflow_run:
workflows: ["Build"]
types:
- completed
permissions: {}

jobs:
test-results:
name: "Test Results"
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'
permissions:
checks: write
contents: read
issues: read
actions: read
steps:
- name: Download and Extract Artifacts
uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615
with:
run_id: ${{ github.event.workflow_run.id }}
path: artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
comment_mode: off
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/Test Results */*.xml"

0 comments on commit f3c7ee8

Please sign in to comment.