Skip to content

Commit

Permalink
.github: use a junit report for simpler PR checks
Browse files Browse the repository at this point in the history
  • Loading branch information
khancyr committed Oct 20, 2023
1 parent 5a6c0d7 commit f24f8b7
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: 'Test Report'
on:
workflow_run:
workflows: [
'test unit tests and sitl building',
'test blimp',
'test plane',
'test rover',
'test sub',
'test tracker',
'test copter' ] # runs after CI workflow
types:
- completed

permissions:
contents: read
actions: read
checks: write

jobs:
report:
runs-on: ubuntu-latest
# strategy:
# fail-fast: false # don't cancel if a job from the matrix fails
# matrix:
# config: [
# sitltest-plane,
# sitltest-quadplane,
# sitltest-copter-tests1a,
# sitltest-copter-tests1b,
# sitltest-copter-tests1c,
# sitltest-copter-tests1d,
# sitltest-copter-tests1e,
# sitltest-copter-tests2a,
# sitltest-copter-tests2b,
# sitltest-heli,
# sitltest-blimp,
# sitltest-rover,
# sitltest-sailboat,
# sitltest-balancebot,
# sitltest-sub,
# sitltest-tracker,
# base-unit-tests,
# ]

steps:
- uses: dorny/test-reporter@v1
with:
artifact: /test-results-junit-(.*)/ # artifact name
name: Tests Report $1 # Name of the check run which will be created
path: '*.xml' # Path to test results (inside artifact .zip)
reporter: java-junit # Format of test results
6 changes: 6 additions & 0 deletions .github/workflows/test_sitl_blimp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,9 @@ jobs:
path: /__w/ardupilot/ardupilot/logs
retention-days: 7

- uses: actions/upload-artifact@v3 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results-junit-${{matrix.config}}
path: /__w/ardupilot/ardupilot/autotest_result_*_junit.xml
retention-days: 1
14 changes: 14 additions & 0 deletions .github/workflows/test_sitl_copter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ jobs:
path: /__w/ardupilot/ardupilot/logs
retention-days: 7

- uses: actions/upload-artifact@v3 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results-junit
path: /__w/ardupilot/ardupilot/autotest_result_*_junit.xml
retention-days: 1

build-gcc-heli:
runs-on: ubuntu-22.04
container:
Expand Down Expand Up @@ -367,3 +374,10 @@ jobs:
name: BIN-${{matrix.config}}
path: /__w/ardupilot/ardupilot/logs
retention-days: 7

- uses: actions/upload-artifact@v3 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results-junit-${{matrix.config}}
path: /__w/ardupilot/ardupilot/autotest_result_*_junit.xml
retention-days: 1
6 changes: 6 additions & 0 deletions .github/workflows/test_sitl_plane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,9 @@ jobs:
path: /__w/ardupilot/ardupilot/logs
retention-days: 7

- uses: actions/upload-artifact@v3 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results-junit-${{matrix.config}}
path: /__w/ardupilot/ardupilot/autotest_result_*_junit.xml
retention-days: 1
6 changes: 6 additions & 0 deletions .github/workflows/test_sitl_rover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,9 @@ jobs:
path: /__w/ardupilot/ardupilot/logs
retention-days: 7

- uses: actions/upload-artifact@v3 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results-junit-${{matrix.config}}
path: /__w/ardupilot/ardupilot/autotest_result_*_junit.xml
retention-days: 1
6 changes: 6 additions & 0 deletions .github/workflows/test_sitl_sub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,9 @@ jobs:
path: /__w/ardupilot/ardupilot/logs
retention-days: 7

- uses: actions/upload-artifact@v3 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results-junit-${{matrix.config}}
path: /__w/ardupilot/ardupilot/autotest_result_*_junit.xml
retention-days: 1
6 changes: 6 additions & 0 deletions .github/workflows/test_sitl_tracker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,9 @@ jobs:
path: /__w/ardupilot/ardupilot/logs
retention-days: 7

- uses: actions/upload-artifact@v3 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results-junit-${{matrix.config}}
path: /__w/ardupilot/ardupilot/autotest_result_*_junit.xml
retention-days: 1
7 changes: 7 additions & 0 deletions .github/workflows/test_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,10 @@ jobs:
name: fail-${{ matrix.toolchain }}-${{matrix.config}}
path: /tmp/buildlogs
retention-days: 14

- uses: actions/upload-artifact@v3 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results-junit-${{ matrix.toolchain }}-${{matrix.config}}
path: /__w/ardupilot/ardupilot/autotest_result_*_junit.xml
retention-days: 1

0 comments on commit f24f8b7

Please sign in to comment.