Skip to content

Commit 7e201e4

Browse files
committed
Only run benchmarks for PRs that modify code
Also run benchmarks when test inventory or dependencies are modified.
1 parent f58807f commit 7e201e4

2 files changed

Lines changed: 24 additions & 14 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Benchmarks
2+
3+
on:
4+
# Only run benchmarks for PRs that modify code, dependencies or test inventory
5+
pull_request:
6+
paths:
7+
- 'src/**'
8+
- 'benches/**'
9+
- 'Cargo.toml'
10+
- 'tests/inventory/**'
11+
12+
jobs:
13+
benchmarks:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions-rs/toolchain@v1
18+
with:
19+
toolchain: stable
20+
profile: minimal
21+
- uses: boa-dev/criterion-compare-action@v3
22+
with:
23+
features: bench
24+
branchName: ${{ github.base_ref }}

.github/workflows/rust.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,3 @@ jobs:
4545
- uses: actions-rs/cargo@v1
4646
with:
4747
command: test
48-
49-
benchmarks:
50-
runs-on: ubuntu-latest
51-
if: github.base_ref != ''
52-
steps:
53-
- uses: actions/checkout@v4
54-
- uses: actions-rs/toolchain@v1
55-
with:
56-
toolchain: stable
57-
profile: minimal
58-
- uses: boa-dev/criterion-compare-action@v3
59-
with:
60-
features: bench
61-
branchName: ${{ github.base_ref }}

0 commit comments

Comments
 (0)