Skip to content

Commit

Permalink
Only run benchmarks for PRs that modify code
Browse files Browse the repository at this point in the history
Also run benchmarks when test inventory or dependencies are modified.
  • Loading branch information
simu committed Mar 19, 2024
1 parent f58807f commit 7e201e4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Benchmarks

on:
# Only run benchmarks for PRs that modify code, dependencies or test inventory
pull_request:
paths:
- 'src/**'
- 'benches/**'
- 'Cargo.toml'
- 'tests/inventory/**'

jobs:
benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- uses: boa-dev/criterion-compare-action@v3
with:
features: bench
branchName: ${{ github.base_ref }}
14 changes: 0 additions & 14 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,3 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test

benchmarks:
runs-on: ubuntu-latest
if: github.base_ref != ''
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- uses: boa-dev/criterion-compare-action@v3
with:
features: bench
branchName: ${{ github.base_ref }}

0 comments on commit 7e201e4

Please sign in to comment.