Skip to content

Commit

Permalink
Only build benchmark dependencies when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
jhpratt committed Nov 9, 2021
1 parent 10b8c5c commit 86942f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ jobs:
with:
command: check
args: --benches --all-features
env:
RUSTFLAGS: "--cfg bench"

test:
name: Test (${{ matrix.os.name }}, ${{ matrix.rust }})
Expand Down Expand Up @@ -273,6 +275,8 @@ jobs:
with:
command: fmt
args: --all -- --check
env:
RUSTFLAGS: "--cfg bench"

clippy:
name: Clippy
Expand All @@ -298,6 +302,8 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --benches --tests
env:
RUSTFLAGS: "--cfg bench"

documentation:
name: Documentation
Expand Down
6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,17 @@ time-macros = { version = "=0.2.3", path = "time-macros", optional = true }
libc = "0.2.98"

[dev-dependencies]
criterion = "0.3.5"
criterion-cycles-per-byte = "0.1.2"
rand = { version = "0.8.4", default-features = false }
serde = { version = "1.0.126", default-features = false }
serde_test = "1.0.126"

[target.'cfg(__ui_tests)'.dev-dependencies]
trybuild = "=1.0.34"

[target.'cfg(bench)'.dev-dependencies]
criterion = "0.3.5"
criterion-cycles-per-byte = "0.1.2"

# Significant contributions to the benchmarks provided by Emil Lundberg.
[[bench]]
name = "benchmarks"
Expand Down

0 comments on commit 86942f5

Please sign in to comment.