Skip to content

Commit

Permalink
Reorder steps
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert committed Mar 14, 2024
1 parent 56c380d commit 2750423
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,34 @@ 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
with:
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
Expand All @@ -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:
Expand Down

0 comments on commit 2750423

Please sign in to comment.