Skip to content

Commit

Permalink
.github/workflows: Add junit test reports as a separate job.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivucica authored Sep 17, 2024
1 parent f096277 commit f27cb7d
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 6 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci-bazel-testreports.yml
Original file line number Diff line number Diff line change
@@ -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'
12 changes: 6 additions & 6 deletions .github/workflows/ci-bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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:
Expand Down Expand Up @@ -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/
Expand All @@ -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
Expand Down

0 comments on commit f27cb7d

Please sign in to comment.