Skip to content

Commit

Permalink
⚡ improve bench workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chriamue committed Feb 21, 2025
1 parent 869416b commit 978ff00
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ jobs:
fetch-depth: 1

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
targets: wasm32-unknown-unknown

- name: Setup rust cache
uses: Swatinem/rust-cache@v2
Expand All @@ -35,16 +39,27 @@ jobs:
target
- name: Check formatting
run: cargo fmt --all -- --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings

- name: Run tests
run: cargo test --all-features
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features

- name: Run benchmarks
run: cargo bench
uses: actions-rs/cargo@v1
with:
command: bench
env:
CARGO_TERM_COLOR: always

Expand All @@ -71,15 +86,16 @@ jobs:
tool: "criterion"
output-file-path: target/criterion/**/new/*.json
alert-threshold: "150%"
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Check benchmark results
if: github.event_name == 'pull_request'
run: |
if [ -f prev-benchmark/bench_result.json ]; then
# Add custom benchmark comparison logic here
echo "Comparing benchmark results..."
fi
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTFLAGS: "-D warnings"

0 comments on commit 978ff00

Please sign in to comment.