From 9d005432c58ab54dc41fc1ba00ec47307bb8666c Mon Sep 17 00:00:00 2001 From: WorldSEnder Date: Sat, 17 Dec 2022 10:18:56 +0000 Subject: [PATCH] Try fixing the post-comment benchmark action (#3045) * Try fixing the post comment benchmark action Store the complete event in PR_INFO Checkout repo for github-action-benchmark * add missing string escape --- .github/workflows/benchmark.yml | 2 +- .github/workflows/post-benchmark.yml | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 5c8464d0b31..ff1a35b91cf 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -112,7 +112,7 @@ jobs: run: | mkdir artifacts/ jq -s . js-framework-benchmark/webdriver-ts/results/*.json | cargo run --manifest-path yew/tools/Cargo.toml --release -p process-benchmark-results > artifacts/results.json - echo ${{ github.event.number }} > artifacts/PR_INFO + echo "${{ toJSON(github.event) }}" > artifacts/PR_INFO - name: Upload result artifacts uses: actions/upload-artifact@v3 diff --git a/.github/workflows/post-benchmark.yml b/.github/workflows/post-benchmark.yml index 3fa3a8b4e99..eb4930bc496 100644 --- a/.github/workflows/post-benchmark.yml +++ b/.github/workflows/post-benchmark.yml @@ -18,12 +18,16 @@ jobs: workflow: benchmark.yml run_id: ${{ github.event.workflow_run.id }} name: results + path: ./artifacts + + # Checkout repo for the github-action-benchmark action + - uses: actions/checkout@v2 - name: Test for PR uses: mathiasvr/command-output@v1 id: test-pr with: - run: cat PR_INFO + run: cat artifacts/PR_INFO # gh-pages branch is updated and pushed automatically with extracted benchmark data - name: Store benchmark result @@ -31,12 +35,13 @@ jobs: with: name: "Yew master branch benchmarks (Lower is better)" tool: "customSmallerIsBetter" - output-file-path: results.json + output-file-path: artifacts/results.json gh-pages-branch: "gh-pages" # Access token to deploy GitHub Pages branch github-token: ${{ secrets.GITHUB_TOKEN }} # Push and deploy GitHub pages branch automatically alert-threshold: "200%" alert-comment-cc-users: "@yewstack/yew" - auto-push: true - save-data-file: ${{ steps.test-pr.outputs.stdout == '' }} + # Only push when this is a non-pr commit that has been benchmarked, i.e. master + auto-push: ${{ fromJSON(steps.test-pr.outputs.stdout).number == '' }} + save-data-file: ${{ fromJSON(steps.test-pr.outputs.stdout).number == '' }}