Skip to content

Commit

Permalink
Print bench outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelburnham committed Oct 31, 2023
1 parent a976955 commit 2b04066
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/merge-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
jobs:
gpu-benchmark:
# Test working run
if: github.event_name != 'pull_request' || github.event.action == 'enqueued'
#if: github.event_name != 'pull_request' || github.event.action == 'enqueued'
name: Run fibonacci bench
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -43,25 +43,30 @@ jobs:
- name: Run bench on base branch
run: cd main/benches && just --dotenv-filename bench.env bench fibonacci
- name: Copy bench output to PR branch
run: ls -a && cp main/${{ env.BASE_REF }}.json .
run: cp main/${{ env.BASE_REF }}.json .
- name: Print base bench
run: cat ${{ env.BASE_REF }}.json
- name: Run bench on PR branch
run: ls -a && cd benches && just --dotenv-filename bench.env bench fibonacci
run: cd benches && just --dotenv-filename bench.env bench fibonacci
- name: Print PR bench
run: cat ${{ github.sha }}.json
# Create a `criterion-table` and write in commit comment
- name: Run `criterion-table`
run: cat ${{ github.sha }}.json | criterion-table > BENCHMARKS.md
- name: Write bench on commit comment
uses: peter-evans/commit-comment@v3
with:
body-path: BENCHMARKS.md
#- name: Write bench on commit comment
# uses: peter-evans/commit-comment@v3
# with:
# body-path: BENCHMARKS.md
# TODO: Use jq for JSON parsing if needed
# Check for benchmark regression based on Criterion's configured noise threshold
- name: Performance regression check
id: check-regression
run: |
echo $(grep -c 'Regressed' ${{ github.sha }}.json)
echo "regress_count=$(grep -c 'Regressed' ${{ github.sha }}.json)" >> $GITHUB_OUTPUT
# Fail job if regression found
- uses: actions/github-script@v6
if: ${{ steps.check-regression.outputs.regress_count }} > 0
if: ${{ steps.check-regression.outputs.regress_count > 0 }}
with:
script: |
core.setFailed('Fibonacci bench regression detected')

0 comments on commit 2b04066

Please sign in to comment.