Skip to content

Commit

Permalink
ci: fix benchmark workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
kod-kristoff committed Dec 9, 2024
1 parent b7bb612 commit 1f51a02
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/benchmarks_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
- uses: bencherdev/bencher@main
- name: Track base branch benchmarks with Bencher
run: |
source .venv/bin/activate
bencher run \
--project json-arrays-py \
--token '${{ secrets.BENCHER_API_TOKEN }}' \
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/benchmarks_fork_pr_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ env:
MINIMUM_PYTHON_VERSION: "3.9"
UV_VERSION: "0.5.1"

# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that
# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
benchmark_fork_pr_branch:
name: ubuntu / ${{ matrix.python-version }} / run fork pr benchmarks
# DO NOT REMOVE: For handling Fork PRs see Pull Requests from Forks
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
strategy:
max-parallel: 4
Expand Down Expand Up @@ -44,7 +52,7 @@ jobs:
- name: Upload Benchmark Results
uses: actions/upload-artifact@v4
with:
name: benchmark_results.json
name: benchmark_results-${{ matrix.python-version }}.json
path: ./benchmark_results-${{ matrix.python-version }}.json
- name: Upload GitHub Pull Request Event
uses: actions/upload-artifact@v4
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/benchmarks_fork_pr_track.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
workflows: [benchmarks_fork_pr_run]
types: [completed]

# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that
# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
track_fork_pr_branch:
name: ubuntu / ${{ matrix.python-version }} / track fork prs with bencher
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/benchmarks_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ on:
types: [opened, reopened, edited, synchronize]
name: benchmarks_pr

# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that
# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
MINIMUM_PYTHON_VERSION: "3.9"
UV_VERSION: "0.5.1"
Expand Down Expand Up @@ -44,6 +50,7 @@ jobs:
- uses: bencherdev/bencher@main
- name: Track PR Benchmarks with Bencher
run: |
source .venv/bin/activate
bencher run \
--project json-arrays-py \
--token '${{ secrets.BENCHER_API_TOKEN }}' \
Expand Down

0 comments on commit 1f51a02

Please sign in to comment.