@@ -29,45 +29,45 @@ jobs:
2929 name : Performance Benchmark
3030 runs-on : ubuntu-latest
3131 steps :
32- - uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
33-
34-
35-
36- - name : Install Rust
37- uses : dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
38-
39- - name : Install cargo-criterion
40- run : cargo install cargo-criterion
41-
42- - name : Cache cargo registry
43- uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
44- with :
45- path : |
46- ~/.cargo/registry
47- ~/.cargo/git
48- key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
49-
50- - name : Cache target
51- uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
52- with :
53- path : target
54- key : ${{ runner.os }}-bench-target-${{ hashFiles('**/Cargo.lock') }}
55-
56- - name : Run criterion benchmarks
57- run : |
58- echo "Checking for benchmark files..."
59- find . -name "*.rs" -path "*/benches/*" -ls || echo "No benchmark files found in benches/"
60-
61- # Check if we have criterion benchmarks defined in Cargo.toml
62- if find . -name "Cargo.toml" -exec grep -l "criterion" {} \; | head -1; then
63- echo "Found criterion in dependencies, running benchmarks..."
64- # Run benchmarks for each crate that has them
65- for crate_dir in crates/*/; do
66- if [ -f "$crate_dir/Cargo.toml" ] && grep -q "criterion" "$crate_dir/Cargo.toml"; then
67- echo "Running benchmarks for $crate_dir"
68- (cd "$crate_dir" && cargo bench) || echo "Benchmarks failed or not available for $crate_dir"
69- fi
70- done
32+ - uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
33+
34+
35+
36+ - name : Install Rust
37+ uses : dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6
38+
39+ - name : Install cargo-criterion
40+ run : cargo install cargo-criterion
41+
42+ - name : Cache cargo registry
43+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
44+ with :
45+ path : |
46+ ~/.cargo/registry
47+ ~/.cargo/git
48+ key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
49+
50+ - name : Cache target
51+ uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
52+ with :
53+ path : target
54+ key : ${{ runner.os }}-bench-target-${{ hashFiles('**/Cargo.lock') }}
55+
56+ - name : Run criterion benchmarks
57+ run : |
58+ echo "Checking for benchmark files..."
59+ find . -name "*.rs" -path "*/benches/*" -ls || echo "No benchmark files found in benches/"
60+
61+ # Check if we have criterion benchmarks defined in Cargo.toml
62+ if find . -name "Cargo.toml" -exec grep -l "criterion" {} \; | head -1; then
63+ echo "Found criterion in dependencies, running benchmarks..."
64+ # Run benchmarks for each crate that has them
65+ for crate_dir in crates/*/; do
66+ if [ -f "$crate_dir/Cargo.toml" ] && grep -q "criterion" "$crate_dir/Cargo.toml"; then
67+ echo "Running benchmarks for $crate_dir"
68+ (cd "$crate_dir" && cargo bench) || echo "Benchmarks failed or not available for $crate_dir"
69+ fi
70+ done
7171 else
7272 echo "No criterion benchmarks configured, running cargo test --benches..."
7373 cargo test --benches --workspace || echo "No bench tests available"
0 commit comments