name: CodSpeed
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
codspeed:
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup rust toolchain, cache and cargo-codspeed binary
uses: moonrepo/setup-rust@v1
with:
channel: stable
components: rustfmt, clippy
cache-target: release
target-dirs: tools/codspeed/target
cache-extra-identifier: ${{ hashFiles('tools/codspeed/Cargo.lock') }}
bins: cargo-codspeed
- name: Check benchmark formatting and lints
working-directory: tools/codspeed
run: |
cargo fmt --check
cargo clippy --all-targets --all-features --locked -- -D warnings -D clippy::pedantic
- name: Build the benchmark target(s)
working-directory: tools/codspeed
run: cargo codspeed build -m simulation --locked
- name: Run the benchmarks
uses: CodSpeedHQ/action@v5
with:
mode: simulation
working-directory: tools/codspeed
run: cargo codspeed run