From dec288e232ebc9f5fa20539381237bdc377744e0 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Thu, 19 Oct 2023 22:42:49 +0200 Subject: [PATCH] .github: use a junit report for simpler PR checks --- .github/workflows/test-report.yml | 52 +++++++++++++++++++++++++ .github/workflows/test_sitl_blimp.yml | 6 +++ .github/workflows/test_sitl_copter.yml | 14 +++++++ .github/workflows/test_sitl_plane.yml | 6 +++ .github/workflows/test_sitl_rover.yml | 6 +++ .github/workflows/test_sitl_sub.yml | 6 +++ .github/workflows/test_sitl_tracker.yml | 6 +++ .github/workflows/test_unit_tests.yml | 7 ++++ 8 files changed, 103 insertions(+) create mode 100644 .github/workflows/test-report.yml diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml new file mode 100644 index 00000000000000..e20701e3d92589 --- /dev/null +++ b/.github/workflows/test-report.yml @@ -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 diff --git a/.github/workflows/test_sitl_blimp.yml b/.github/workflows/test_sitl_blimp.yml index b346efdcbe699b..ba32da000d9c92 100644 --- a/.github/workflows/test_sitl_blimp.yml +++ b/.github/workflows/test_sitl_blimp.yml @@ -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 diff --git a/.github/workflows/test_sitl_copter.yml b/.github/workflows/test_sitl_copter.yml index c2133a5a1d4990..681fdf31698a3d 100644 --- a/.github/workflows/test_sitl_copter.yml +++ b/.github/workflows/test_sitl_copter.yml @@ -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: @@ -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 diff --git a/.github/workflows/test_sitl_plane.yml b/.github/workflows/test_sitl_plane.yml index 66bb9a7ebf3b18..1e5e369fbfaf54 100644 --- a/.github/workflows/test_sitl_plane.yml +++ b/.github/workflows/test_sitl_plane.yml @@ -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 diff --git a/.github/workflows/test_sitl_rover.yml b/.github/workflows/test_sitl_rover.yml index a6f3d669b32763..23c82ccfcca70e 100644 --- a/.github/workflows/test_sitl_rover.yml +++ b/.github/workflows/test_sitl_rover.yml @@ -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 diff --git a/.github/workflows/test_sitl_sub.yml b/.github/workflows/test_sitl_sub.yml index cbe5aaddf1b027..5f8d6d9470461d 100644 --- a/.github/workflows/test_sitl_sub.yml +++ b/.github/workflows/test_sitl_sub.yml @@ -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 diff --git a/.github/workflows/test_sitl_tracker.yml b/.github/workflows/test_sitl_tracker.yml index 8191e57483bf59..8376887e9ea252 100644 --- a/.github/workflows/test_sitl_tracker.yml +++ b/.github/workflows/test_sitl_tracker.yml @@ -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 diff --git a/.github/workflows/test_unit_tests.yml b/.github/workflows/test_unit_tests.yml index 02b174336f945b..ce9d868e146e71 100644 --- a/.github/workflows/test_unit_tests.yml +++ b/.github/workflows/test_unit_tests.yml @@ -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