From 6776372c1ca4fddf4a92719db695af5cc835ffe2 Mon Sep 17 00:00:00 2001 From: Harold Sun Date: Fri, 20 Mar 2026 14:33:18 +0000 Subject: [PATCH] fix: ensure benchmark results are uploaded and commented on failure - Add 'if: always()' to save and upload benchmark results steps so artifacts are available even when the benchmark fails - Update benchmark-comment workflow to only trigger when the benchmark run concludes with failure --- .github/workflows/benchmark-comment.yaml | 2 +- .github/workflows/benchmark.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/benchmark-comment.yaml b/.github/workflows/benchmark-comment.yaml index f5ee7dae..4118591a 100644 --- a/.github/workflows/benchmark-comment.yaml +++ b/.github/workflows/benchmark-comment.yaml @@ -12,7 +12,7 @@ permissions: jobs: comment: runs-on: ubuntu-24.04 - if: github.event.workflow_run.event == 'pull_request' + if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'failure' steps: - name: Download benchmark results uses: actions/download-artifact@v4 diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml index ec7a5922..13f8a1c4 100644 --- a/.github/workflows/benchmark.yaml +++ b/.github/workflows/benchmark.yaml @@ -90,6 +90,7 @@ jobs: fi - name: Save benchmark results + if: always() run: | mkdir -p benchmark-results cp $GITHUB_STEP_SUMMARY benchmark-results/summary.md @@ -97,6 +98,7 @@ jobs: echo "${{ steps.compare.outputs.regression }}" > benchmark-results/regression.txt - name: Upload benchmark results + if: always() uses: actions/upload-artifact@v4 with: name: benchmark-results