From f27cb7d9155fdc70d1fca7d775979d6c44cf60bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Vu=C4=8Dica?= Date: Tue, 17 Sep 2024 18:16:19 +0000 Subject: [PATCH] .github/workflows: Add junit test reports as a separate job. --- .github/workflows/ci-bazel-testreports.yml | 45 ++++++++++++++++++++++ .github/workflows/ci-bazel.yml | 12 +++--- 2 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/ci-bazel-testreports.yml diff --git a/.github/workflows/ci-bazel-testreports.yml b/.github/workflows/ci-bazel-testreports.yml new file mode 100644 index 00000000..f8429d9f --- /dev/null +++ b/.github/workflows/ci-bazel-testreports.yml @@ -0,0 +1,45 @@ +name: Bazel CI test report +on: + workflow_run: + workflows: [ C/C++ and Bazel CI ] + types: [ completed ] + +permissions: + checks: write + +jobs: + checks: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + - name: minimal-regular + place: regular + short_name: minimal + - name: util-regular + place: regular + short_name: util + - name: minimal-buildbuddy + place: buildbuddy + short_name: minimal + - name: util-buildbuddy + place: buildbuddy + short_name: util + + steps: + - name: Download Test Report + uses: dawidd6/action-download-artifact@v2 + with: + name: junit-test-results-${{ matrix.place }}-${{ matrix.short_name }} + workflow: ${{ github.event.workflow.id }} + run_id: ${{ github.event.workflow_run.id }} + - name: Publish Test Report + uses: mikepenz/action-junit-report@v4 + # if we integrate into main bit instead of having a separate workflow: + # if: success() || failure() # always run even if the previous step fails + with: + commit: ${{github.event.workflow_run.head_sha}} # remove if we don't use separate workflow + # some_file.zip/minimal_test/test.xml + report_paths: '**/test.xml' diff --git a/.github/workflows/ci-bazel.yml b/.github/workflows/ci-bazel.yml index 350a66d2..aa71b0ad 100644 --- a/.github/workflows/ci-bazel.yml +++ b/.github/workflows/ci-bazel.yml @@ -101,7 +101,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() # Run even if the previous step fails with: - name: junit-test-results + name: junit-test-results-regular-${{ matrix.name }} path: 'bazel-testlogs/**/test.xml' # TODO: bazel-testlogs/name-of-test has also: # * test.outputs/ @@ -111,12 +111,12 @@ jobs: # * test.cache_status # but they might not be worth uploading at this time. - # retention-days: 3650d # For now, don't delete explicitly, or 10yr. + retention-days: 90 # Maximum is 90d, default is repo settings. - name: Upload test log uses: actions/upload-artifact@v4 if: always() # Run even if the previous step fails with: - name: junit-test-results + name: junit-test-logs-regular-${{ matrix.name }} path: 'bazel-testlogs/**/test.log' bazel_build_buildbuddy: @@ -207,7 +207,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() # Run even if the previous step fails with: - name: junit-test-results + name: junit-test-results-buildbuddy-${{ matrix.name }} path: 'bazel-testlogs/**/test.xml' # TODO: bazel-testlogs/name-of-test has also: # * test.outputs/ @@ -217,12 +217,12 @@ jobs: # * test.cache_status # but they might not be worth uploading at this time. - # retention-days: 3650d # For now, don't delete explicitly, or 10yr. + retention-days: 90 # Maximum and default is 90d but can be shortened. - name: Upload test log uses: actions/upload-artifact@v4 if: always() # Run even if the previous step fails with: - name: junit-test-results + name: junit-test-logs-buildbuddy-${{ matrix.name }} path: 'bazel-testlogs/**/test.log' - name: print ldd