From 20e4b6ac719ce3523c572a65be89bca055c91ae8 Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Mon, 30 Sep 2024 10:58:06 +0200 Subject: [PATCH] Add test report once at the end of the build Issue: ZENKO-4876 --- .github/actions/archive-artifacts/action.yaml | 9 +++++ .github/actions/debug-wait/action.yaml | 4 +- .github/workflows/end2end.yaml | 37 ++++++++++++++++++- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/.github/actions/archive-artifacts/action.yaml b/.github/actions/archive-artifacts/action.yaml index 9ac282393b..dfd92d4d60 100644 --- a/.github/actions/archive-artifacts/action.yaml +++ b/.github/actions/archive-artifacts/action.yaml @@ -35,10 +35,19 @@ runs: - name: Publish test report uses: mikepenz/action-junit-report@v4 with: + annotate_only: true check_name: ${{ inputs.stage}} + job_summary: false report_paths: ${{ inputs.junit-paths }} continue-on-error: true + - name: Upload test reports + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.stage}}-test-report + path: ${{ inputs.junit-paths }} + retention-days: 5 + - name: Upload results if: inputs.trunk_token && job.status != 'cancelled' uses: trunk-io/analytics-uploader@v1.4.0 diff --git a/.github/actions/debug-wait/action.yaml b/.github/actions/debug-wait/action.yaml index 8549d78d51..3829e48896 100644 --- a/.github/actions/debug-wait/action.yaml +++ b/.github/actions/debug-wait/action.yaml @@ -6,11 +6,11 @@ runs: using: composite steps: - name: "Debug: SSH to runner" - uses: scality/actions/action-ssh-to-runner@1.8.0 + uses: scality/actions/action-ssh-to-runner@1.9.0 continue-on-error: true with: tmate-server-host: ${{ env.TMATE_SERVER_HOST }} tmate-server-port: ${{ env.TMATE_SERVER_PORT }} tmate-server-rsa-fingerprint: ${{ env.TMATE_SERVER_RSA_FINGERPRINT }} tmate-server-ed25519-fingerprint: ${{ env.TMATE_SERVER_ED25519_FINGERPRINT }} - if: job.status == 'failure' && runner.debug == '1' + if: runner.debug == '1' diff --git a/.github/workflows/end2end.yaml b/.github/workflows/end2end.yaml index 5f0f2fee8b..b027a15ea8 100644 --- a/.github/workflows/end2end.yaml +++ b/.github/workflows/end2end.yaml @@ -416,6 +416,7 @@ jobs: - name: Debug wait uses: ./.github/actions/debug-wait timeout-minutes: 60 + if: failure() - name: Archive and publish artifacts uses: ./.github/actions/archive-artifacts with: @@ -475,6 +476,7 @@ jobs: - name: Debug wait uses: ./.github/actions/debug-wait timeout-minutes: 60 + if: failure() - name: Archive and publish artifacts uses: ./.github/actions/archive-artifacts with: @@ -526,6 +528,7 @@ jobs: - name: Debug wait uses: ./.github/actions/debug-wait timeout-minutes: 60 + if: failure() - name: Archive and publish artifacts uses: ./.github/actions/archive-artifacts with: @@ -565,6 +568,7 @@ jobs: - name: Debug wait uses: ./.github/actions/debug-wait timeout-minutes: 60 + if: failure() - name: Archive and publish artifacts uses: ./.github/actions/archive-artifacts with: @@ -611,6 +615,7 @@ jobs: - name: Debug wait uses: ./.github/actions/debug-wait timeout-minutes: 60 + if: failure() - name: Archive and publish artifacts uses: ./.github/actions/archive-artifacts with: @@ -635,6 +640,9 @@ jobs: - end2end-sharded - end2end-pra - ctst-end2end-sharded + if: always() + permissions: + checks: write steps: - name: Upload final status uses: scality/actions/upload_final_status@1.8.0 @@ -642,4 +650,31 @@ jobs: ARTIFACTS_USER: ${{ secrets.ARTIFACTS_USER }} ARTIFACTS_PASSWORD: ${{ secrets.ARTIFACTS_PASSWORD }} JOBS_RESULTS: ${{ join(needs.*.result) }} - if: always() + + - name: Download all workflow run artifacts + uses: actions/download-artifact@v4 + + - name: List reports + run: | + REPORT_PATHS= + CHECK_NAMES= + for REPORT in *-test-report ; do + REPORT_PATHS="${REPORT_PATHS}\n${REPORT}/*.xml" + CHECK_NAMES="${CHECK_NAMES}\n${REPORT%-test-report}" + done + + echo -e "REPORT_PATHS<> "$GITHUB_ENV" + echo -e "CHECK_NAMES<> "$GITHUB_ENV" + + - name: Generate summary + id: summary + uses: mikepenz/action-junit-report@v4 + with: + job_summary: true + detailed_summary: true + check_annotations: true + report_paths: ${{ env.REPORT_PATHS }} + check_name: ${{ env.CHECK_NAMES }} + job_name: 🧪 Test results + update_check: true + continue-on-error: true