Skip to content

Commit

Permalink
Only run benchmarks on current branch in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
rlouf committed Oct 21, 2024
1 parent 74e4eb5 commit fa25e8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/asv_benchmark_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
env:
PYTHON_VERSION: "3.10"
WORKING_DIR: ${{ github.workspace }}/src
BENCHMARKS_OUTPUT: ${{ github.workspace }}/results
BENCHMARKS_OUTPUT: ${{ github.workspace }}/src/results

jobs:
benchmark:
Expand Down Expand Up @@ -37,11 +37,6 @@ jobs:
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
# prepare main branch for comparison
git remote add upstream https://github.com/${{ github.repository }}.git
git fetch upstream main
# Run benchmarks, allow errors, they will be caught in the next step
asv run --interleave-rounds -a repeat=3 || true
- name: BENCHMARK RESULTS
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/asv_benchmarks_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
env:
PYTHON_VERSION: "3.10"
WORKING_DIR: ${{ github.workspace }}/src
BENCHMARKS_OUTPUT: ${{ github.workspace }}/results
BENCHMARKS_OUTPUT: ${{ github.workspace }}/src/results

jobs:
benchmark-pr:
Expand Down Expand Up @@ -37,21 +37,11 @@ jobs:
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
# prepare main branch for comparison
git remote add upstream https://github.com/${{ github.repository }}.git
git fetch upstream main
# Run benchmarks, allow errors, they will be caught in the next step
asv continuous --quick upstream/main HEAD \
--no-stats --interleave-rounds -a repeat=3 || true
asv run --quick --interleave-rounds -a repeat=3 || true
- name: BENCHMARK RESULTS
run: |
asv compare --factor=1.1 --no-stats --split upstream/main HEAD | tee ${{ env.BENCHMARKS_OUTPUT }}
if grep -q "Benchmarks that have got worse" "${{ env.BENCHMARKS_OUTPUT }}"; then
echo "Performance degradation detected!"
exit 1
fi
asv show HEAD
- name: Upload Benchmark Results Folder
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit fa25e8c

Please sign in to comment.