Skip to content

Commit

Permalink
fix benchmark yml
Browse files Browse the repository at this point in the history
Signed-off-by: Asish Kumar <[email protected]>
  • Loading branch information
officialasishkumar committed Jul 26, 2024
1 parent 051effd commit 2268f0e
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@ jobs:
with:
fetch-depth: 0

- name: Checkout pull/${{ github.event.number }}
- name: Checkout PR and master branch
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
if: github.event_name == 'pull_request_target'

- name: fetch master branch
run: git fetch origin master:master
if: github.event_name == 'pull_request_target'

- name: Setup LFS
uses: ./.github/actions/setup_lfs

Expand Down Expand Up @@ -101,20 +105,19 @@ jobs:
- name: Run benchmarks for base and head commits of PR
if: github.event_name == 'pull_request_target'
run: |
echo ${{ github.event.pull_request.base.sha }} > commit_hashes.txt
echo ${{ github.event.pull_request.head.sha }} >> commit_hashes.txt
echo $(git rev-parse HEAD) > commit_hashes.txt
echo $(git rev-parse master) >> commit_hashes.txt
asv run -a repeat=2 -a rounds=1 HASHFILE:commit_hashes.txt | tee asv-output-PR.log
if grep -q failed asv-output-PR.log; then
echo "Some benchmarks have failed!"
exit 1
fi
- name: Compare Master and PR head
run: asv compare ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} --config asv.conf.json | tee asv-compare-output.log
run: asv compare origin/master HEAD --config asv.conf.json | tee asv-compare-output.log

- name: Compare Master and PR head but only show changed results
run: asv compare ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} --only-changed --config asv.conf.json | tee asv-compare-changed-output.log
run: asv compare origin/master HEAD --only-changed --config asv.conf.json | tee asv-compare-changed-output.log

- name: Benchmarks compare output
id: asv_pr_vs_master
Expand Down

0 comments on commit 2268f0e

Please sign in to comment.