Skip to content

Commit

Permalink
publishing test results
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Florentine <justin+github@florentine.us>
  • Loading branch information
jflo committed Nov 30, 2023
1 parent a899074 commit 5e1272f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 44 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,8 @@ jobs:
run: ./gradlew acceptanceTest --tests `cat gradleArgs.txt`
- name: cleanup tempfiles
run: rm testList.txt gradleArgs.txt
- name: Upload Test Report
uses: actions/upload-artifact@v3
if: always() # always run even if the previous step fails
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the build step fails
with:
name: junit-acceptance-${{ matrix.runner-index }}-test-results
path: 'acceptance-tests/tests/build/test-results/acceptanceTest/TEST-*.xml'
retention-days: 1
- name: Acceptance Test Report html
uses: actions/upload-artifact@v3
if: always() # always run even if the previous step fails
with:
name: html-acceptance-${{ matrix.runner-index }}-test-results
path: 'acceptance-tests/tests/build/reports/tests/acceptanceTest/**'
retention-days: 1
report_paths: 'acceptance-tests/tests/build/test-results/acceptanceTest/TEST-*.xml'
20 changes: 2 additions & 18 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,21 @@ name: report
on:
workflow_call:


permissions:
checks: write

jobs:
runner-indexes:
runs-on: ubuntu-22.04
name: Generate runner indexes
outputs:
json: ${{ steps.generate-index-list.outputs.json }}
steps:
- id: generate-index-list
run: |
MAX_INDEX=$((${{ env.total-runners }}-1))
INDEX_LIST=$(seq 0 ${MAX_INDEX})
INDEX_JSON=$(jq --null-input --compact-output '. |= [inputs]' <<< ${INDEX_LIST})
echo "::set-output name=json::${INDEX_JSON}"
unit-tests:
runs-on: ubuntu-22.04
strategy:
matrix:
runner-index: ${{ fromjson(needs.runner-indexes.outputs.json) }}
steps:
- name: Download Test Report
uses: dawidd6/action-download-artifact@v2
with:
name: junit-test-${{ matrix.runner-index }}-results
name: junit-test-results
workflow: ${{ github.event.workflow.id }}
run_id: ${{ github.event.workflow_run.id }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
uses: mikepenz/action-junit-report@v4
with:
commit: ${{github.event.workflow_run.head_sha}}
report_paths: '**/build/test-results/test/TEST-*.xml'
Expand Down
17 changes: 4 additions & 13 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,8 @@ jobs:
gradle-home-cache-cleanup: true
cache-read-only: false
arguments: build -Dorg.gradle.parallel=true
- name: Upload Unit Test Report
uses: actions/upload-artifact@v3
if: always() # always run even if the build tests fail
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the build step fails
with:
name: junit-unit-test-results
path: '**/test-results/test/TEST-*.xml'
retention-days: 10
- name: Unit Test Report html
uses: actions/upload-artifact@v3
if: always() # always run even if the previous step fails
with:
name: html-unit-${{ matrix.runner-index }}-test-results
path: '**/build/reports/tests/test/**'
retention-days: 10
report_paths: '**/test-results/test/TEST-*.xml'

0 comments on commit 5e1272f

Please sign in to comment.