Skip to content

Codspeed

Codspeed #2

Workflow file for this run

name: MicroBenchmarks
on:
push:
branches:
- "main"
pull_request:
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:
jobs:
benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
# this line means that only the main branch writes to the cache
# benefits:
# * prevents main branch caches from being evicted in favor of a PR cache
# * saves about 1min per workflow by skipping the actual cache write
# downsides:
# * PRs that update rust version or changes deps will be slow to iterate on due to changes not being cached.
save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: taiki-e/install-action@v2
with:
tool: cargo-codspeed
- name: Build the benchmark target(s)
run: cargo codspeed build --features alpha-transforms
- name: Run the benchmarks
uses: CodSpeedHQ/action@v2
with:
run: cargo codspeed run --features alpha-transforms