Skip to content

Commit

Permalink
🐛 fix bench workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chriamue committed Feb 21, 2025
1 parent 648169e commit bc7c975
Showing 1 changed file with 20 additions and 52 deletions.
72 changes: 20 additions & 52 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,74 +6,42 @@ on:
- main
pull_request:
types: [opened, synchronize]
# Allow manual triggering
workflow_dispatch:

jobs:
benchmark:
name: Run tests and benchmarks
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/checkout@v1

- uses: jetli/wasm-pack-action@v0.4.0
- name: Cache cargo registry
uses: actions/cache@v1
with:
version: "latest"
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Install just
uses: extractions/setup-just@v1
- name: Cache cargo build
uses: actions/cache@v1
with:
just-version: "1.39"
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
- 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
- uses: actions-rs/cargo@v1
with:
shared-key: "benchmark-cache"
cache-directories: |
~/.cargo/registry
~/.cargo/git
target
- name: Check formatting
run: just fmt

- name: Run lints
run: just lint
command: check

- name: Run tests
run: just test
- name: test
run: cargo test

- name: Run benchmarks
run: just bench
env:
CARGO_TERM_COLOR: always

- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmark-results-${{ github.sha }}
path: |
./target/criterion/**/*.json
./target/criterion/**/*.svg
if-no-files-found: error
retention-days: 90
- name: bench
run: cargo bench

- name: Download previous benchmark data
uses: actions/download-artifact@v4
continue-on-error: true
- uses: actions/upload-artifact@v4
with:
path: prev-benchmark
name: benchmark-results-${{ github.event.before }}
name: rsstable_${{ github.sha }}_bench
path: ./target/criterion

0 comments on commit bc7c975

Please sign in to comment.