name: CodSpeed
on:
push:
branches: [ "main" ]
pull_request:
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
benchmarks:
name: Run benchmarks
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Install Rust
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 with:
toolchain: stable
- name: Cache cargo
uses: Swatinem/rust-cache@f0d9c3887740aee45f6153b24b3a6b815192ec16 with:
shared-key: "codspeed"
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install cargo-codspeed
uses: taiki-e/install-action@cfdb7ed4ccc7c7dce37759eae89dc5674b469b39 with:
tool: cargo-codspeed
- name: Build the benchmark target(s)
run: cargo codspeed build -m simulation --features mock --locked
- name: Run the benchmarks
uses: CodSpeedHQ/action@af75f77f17a054769abefaa42fe8dc2975469b5f with:
mode: simulation
run: cargo codspeed run