@@ -47,33 +47,28 @@ jobs:
4747 run : |
4848 pdm run benchmark --benchmark-json bench.json
4949
50- # If on main branch, upload benchmark results
50+ # Store benchmark results as a GitHub commit comment
5151 - name : Store main benchmark result
5252 if : github.ref == 'refs/heads/main'
53- uses : actions/upload-artifact@v3
53+ uses : benchmark-action/github-action-benchmark@v1
5454 with :
55- name : main-benchmark
56- path : bench.json
57- retention-days : 30
55+ name : Python Benchmark
56+ tool : ' pytest'
57+ output-file-path : bench.json
58+ github-token : ${{ secrets.GITHUB_TOKEN }}
59+ auto-push : true
60+ # Store benchmarks on gh-pages branch
61+ gh-pages-branch : gh-pages
5862
59- # If PR, download main benchmark data
60- - name : Download main benchmark data
61- if : github.event_name == 'pull_request'
62- id : download-main-benchmark
63- uses : actions/download-artifact@v3
64- with :
65- name : main-benchmark
66- path : main-bench
67- continue-on-error : true
68-
63+ # For PRs, the benchmark comparison will automatically happen
64+ # since we're now storing benchmarks on the gh-pages branch
6965 - name : Compare benchmarks
70- if : github.event_name == 'pull_request' && steps.download-main-benchmark.outcome == 'success'
66+ if : github.event_name == 'pull_request'
7167 uses : benchmark-action/github-action-benchmark@v1
7268 with :
7369 name : Python Benchmark
7470 tool : ' pytest'
7571 output-file-path : bench.json
76- external-data-json-path : main-bench/bench.json
7772 github-token : ${{ secrets.GITHUB_TOKEN }}
7873 comment-always : true
7974 fail-threshold : ' 150%'
0 commit comments