From 2750423b08db37a2541ad0aee72b3cb2360bf66c Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Thu, 14 Mar 2024 21:55:36 +1000 Subject: [PATCH] Reorder steps --- .github/workflows/bench.yml | 42 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 3a4a7875c..fbe250d09 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -115,6 +115,27 @@ jobs: perf report -i server/perf.data --no-children --stdio > server.perf.txt & wait + - name: Format results as Markdown + id: results + run: | + { + echo "### Benchmark results" + echo + echo "Performance differences relative to $(cat target/criterion/baseline-sha.txt)." + echo + } > results.md + grep -Ev 'ignored|running \d+ tests|%\)' results.txt |\ + sed -E -e 's/(Performance has regressed.)/:broken_heart: **\1**/gi' \ + -e 's/(Performance has improved.)/:green_heart: **\1**/gi' \ + -e 's/^ +/ /gi' \ + -e 's/^([a-z0-9].*)$/* **\1**/gi' \ + -e 's/(change:[^%]*% )([^%]*%)(.*)/\1**\2**\3/gi' \ + >> results.md + + - name: Remember main-branch push URL + if: github.ref == 'refs/heads/main' + run: echo "${{ github.sha }}" > target/criterion/baseline-sha.txt + - name: Cache main-branch results if: github.ref == 'refs/heads/main' uses: actions/cache/save@v4 @@ -122,10 +143,6 @@ jobs: path: ./target/criterion key: criterion-${{ runner.name }}-${{ hashFiles('./target/criterion/**.json') }} - - name: Remember main-branch push URL - if: github.ref == 'refs/heads/main' - run: echo "${{ github.sha }}" > target/criterion/baseline-sha.txt - - name: Export perf data id: export uses: actions/upload-artifact@v4 @@ -139,23 +156,6 @@ jobs: target/criterion* compression-level: 9 - - name: Format results as Markdown - id: results - run: | - { - echo "### Benchmark results" - echo - echo "Performance differences relative to $(cat target/criterion/baseline-sha.txt)." - echo - } > results.md - grep -Ev 'ignored|running \d+ tests|%\)' results.txt |\ - sed -E -e 's/(Performance has regressed.)/:broken_heart: **\1**/gi' \ - -e 's/(Performance has improved.)/:green_heart: **\1**/gi' \ - -e 's/^ +/ /gi' \ - -e 's/^([a-z0-9].*)$/* **\1**/gi' \ - -e 's/(change:[^%]*% )([^%]*%)(.*)/\1**\2**\3/gi' \ - >> results.md - - name: Export PR comment data uses: ./.github/actions/pr-comment-data-export with: