diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 4de305a..5986821 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -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 @@ -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 @@ -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"