Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit hash of PR HEAD not found fix #2747

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading