Skip to content

Commit 5c72b09

Browse files
Merge pull request #388 from wcampbell0x2a/add-ci-benchmark
Add ci benchmark
2 parents dae1e70 + e1e1399 commit 5c72b09

File tree

5 files changed

+39
-16
lines changed

5 files changed

+39
-16
lines changed

.github/workflows/benchmark.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
on: [pull_request]
2+
name: CI Pull Request
3+
jobs:
4+
benchmark:
5+
name: Benchmark
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
10+
with:
11+
fetch-depth: 0
12+
- uses: dtolnay/rust-toolchain@439cf607258077187679211f12aa6f19af4a0af7 # master
13+
with:
14+
toolchain: stable
15+
- uses: boa-dev/criterion-compare-action@v3
16+
with:
17+
branchName: ${{ github.base_ref }}
18+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/main.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,6 @@ jobs:
8585
# run tests with native unsquashfs on x86_64-unknown-linux-musl (using Cross.toml)
8686
- run: CROSS_CONTAINER_OPTS="--network host" RUST_LOG=info cross test --workspace --release ${{ matrix.features }} --target ${{ matrix.target }} --locked --features __test_unsquashfs -- --skip slow
8787

88-
89-
# benchmark
90-
benchmark:
91-
runs-on: ubuntu-latest
92-
strategy:
93-
matrix:
94-
toolchain:
95-
- stable
96-
97-
steps:
98-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
99-
- uses: dtolnay/rust-toolchain@439cf607258077187679211f12aa6f19af4a0af7 # master
100-
with:
101-
toolchain: ${{ matrix.toolchain }}
102-
- run: cargo bench
103-
10488
# fmt and clippy on stable
10589
fmt-clippy-stable:
10690
runs-on: ubuntu-latest

backhand-cli/Cargo.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ backhand = { path = "../backhand", default-features = false }
2323
tracing = "0.1.40"
2424
color-print = "0.3.5"
2525

26+
[lib]
27+
bench = false
28+
2629
[target.'cfg(all(target_env = "musl", target_pointer_width = "64"))'.dependencies.jemallocator]
2730
version = "0.5.4"
2831

@@ -43,3 +46,15 @@ zstd = ["backhand/zstd"]
4346
[package.metadata.docs.rs]
4447
all-features = true
4548
rustdoc-args = ["--cfg", "docsrs"]
49+
50+
[[bin]]
51+
name = "add"
52+
bench = false
53+
54+
[[bin]]
55+
name = "unsquashfs"
56+
bench = false
57+
58+
[[bin]]
59+
name = "replace"
60+
bench = false

backhand-test/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ env_logger = "0.10.1"
1818
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "fmt"] }
1919
nix = { version = "0.27.1", default-features = false, features = ["fs"] }
2020

21+
[lib]
22+
bench = false
23+
2124
[features]
2225
# testing only feature for testing vs squashfs-tools/unsquashfs
2326
__test_unsquashfs = []

backhand/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ harness = false
5151
[package.metadata.docs.rs]
5252
all-features = true
5353
rustdoc-args = ["--cfg", "docsrs"]
54+
55+
[lib]
56+
bench = false

0 commit comments

Comments
 (0)