Skip to content

Commit de261d5

Browse files
authored
.github: Only test benchmarks, don't run them (#2042)
Instead of fully executing benchmarks, i.e. running multiple iterations, each measured and recorded, only test that they compile and run them with a single execution to make sure they work. The benefit is a reduced CI runtime. Flag documentation: > To test that the benchmarks run successfully without performing the measurement or analysis (eg. in a CI setting), use cargo test --benches. https://bheisler.github.io/criterion.rs/book/user_guide/command_line_options.html The above assumes that (a) the benchmark results from CI are likely noisy and thus (b) no one actually looks at the benchmark results.
1 parent 2d995a6 commit de261d5

File tree

1 file changed

+3
-35
lines changed

1 file changed

+3
-35
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
- name: Run tests, with all features
3838
run: cargo test --workspace --all-features
3939

40+
- name: Run benches, with all features
41+
run: cargo test --workspace --benches --all-features
42+
4043
test-wasm:
4144
name: Build on WASM
4245
runs-on: ubuntu-latest
@@ -140,41 +143,6 @@ jobs:
140143
command: clippy
141144
args: -- -A clippy::type_complexity -A clippy::pedantic -A clippy::style
142145

143-
run-benchmarks:
144-
runs-on: ubuntu-latest
145-
steps:
146-
147-
- name: Cancel Previous Runs
148-
uses: styfle/[email protected]
149-
with:
150-
access_token: ${{ github.token }}
151-
152-
- uses: actions/checkout@v2
153-
154-
- uses: actions-rs/toolchain@v1
155-
with:
156-
profile: minimal
157-
toolchain: stable
158-
override: true
159-
160-
- name: Cache CARGO_HOME
161-
uses: actions/[email protected]
162-
with:
163-
path: ~/.cargo
164-
key: cargo-home-${{ hashFiles('Cargo.toml') }}
165-
166-
- name: Cache cargo build
167-
uses: actions/[email protected]
168-
with:
169-
path: target
170-
key: cargo-build-target-${{ hashFiles('Cargo.toml') }}
171-
172-
- name: Run cargo bench
173-
uses: actions-rs/cargo@v1
174-
with:
175-
command: bench
176-
args: --workspace
177-
178146
integration-test:
179147
name: Integration tests
180148
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)