| 1 |
name: CodSpeed |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- "main" |
| 7 |
pull_request: |
| 8 |
# `workflow_dispatch` allows CodSpeed to trigger backtest |
| 9 |
# performance analysis in order to generate initial data. |
| 10 |
workflow_dispatch: |
| 11 |
|
| 12 |
permissions: |
| 13 |
contents: read |
| 14 |
id-token: write |
| 15 |
|
| 16 |
jobs: |
| 17 |
codspeed: |
| 18 |
name: Run benchmarks |
| 19 |
runs-on: ubuntu-latest |
| 20 |
steps: |
| 21 |
- uses: actions/checkout@v7 |
| 22 |
|
| 23 |
- name: Setup rust toolchain, cache and cargo-codspeed binary |
| 24 |
uses: moonrepo/setup-rust@v1 |
| 25 |
with: |
| 26 |
channel: stable |
| 27 |
cache-target: release |
| 28 |
bins: cargo-codspeed |
| 29 |
|
| 30 |
- name: Build the benchmark target(s) |
| 31 |
run: cargo codspeed build |
| 32 |
|
| 33 |
- name: Run the benchmarks |
| 34 |
uses: CodSpeedHQ/action@v5 |
| 35 |
with: |
| 36 |
mode: simulation |
| 37 |
run: cargo codspeed run |