Skip to content

Commit

Permalink
Adding unit test reporting
Browse files Browse the repository at this point in the history
Should produce a report after the tests run
  • Loading branch information
gregmedd committed May 17, 2024
1 parent 70cb080 commit 087e9c7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
build:
name: Build
name: Build and test
runs-on: ubuntu-latest

steps:
Expand All @@ -37,7 +37,7 @@ jobs:
with:
path: up-cpp

- name: Build && install up-cpp
- name: Build up-cpp with tests
shell: bash
run: |
cd up-cpp
Expand All @@ -48,10 +48,19 @@ jobs:
- name: Run all tests
shell: bash
env:
GTEST_OUTPUT: xml
run: |
cd up-cpp/build
ctest
- name: Upload test results
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results
path: up-cpp/build/test_detail.xml

# NOTE: In GitHub repository settings, the "Require status checks to pass
# before merging" branch protection rule ensures that commits are only merged
# from branches where specific status checks have passed. These checks are
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test Report
on:
workflow_run:
workflows: ['CI']
types:
- completed

permissions:
contents: read
actions: read
checks: write

jobs:
report:
runs-on: ubuntu-latest
steps:

- uses: dorny/test-reporter@v1
with:
artifact: test-results
name: Test Results
path: '*.xml'
reporter: java-junit

0 comments on commit 087e9c7

Please sign in to comment.