Skip to content

Commit

Permalink
🐛 fix bench
Browse files Browse the repository at this point in the history
  • Loading branch information
chriamue committed Feb 21, 2025
1 parent 0878c72 commit b164fcd
Showing 1 changed file with 20 additions and 66 deletions.
86 changes: 20 additions & 66 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,88 +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: bench
run: cargo bench

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
- uses: actions/upload-artifact@v4
with:
name: Rust Benchmark
tool: "criterion"
output-file-path: target/criterion/**/new/*.json
alert-threshold: "150%"
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Comment the following lines to use GitHub Pages instead
gh-pages-branch: gh-pages
benchmark-data-dir-path: dev/bench/data
# Uncomment the following lines to publish to GitHub Pages
# publish-to-github-pages: true
# github-pages-branch: gh-pages
# static-site-dir: dev/bench/

- name: Check benchmark results
if: github.event_name == 'pull_request'
run: |
if [ -f dev/bench/data/latest.json ]; then
echo "Comparing benchmark results..."
fi
- name: Build documentation
run: just docs

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
name: rsstable_${{ github.sha }}_bench
path: ./target/criterion

0 comments on commit b164fcd

Please sign in to comment.