Add CodSpeed continuous benchmarking #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CodSpeed | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| # `workflow_dispatch` allows CodSpeed to trigger backtest | |
| # performance analysis in order to generate initial data. | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write # for OpenID Connect authentication with CodSpeed | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| benchmarks: | |
| name: Run benchmarks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - name: Setup Rust toolchain, cache and cargo-codspeed binary | |
| uses: moonrepo/setup-rust@v0 | |
| with: | |
| channel: stable | |
| cache-target: release | |
| bins: cargo-codspeed | |
| - name: Build the benchmark targets | |
| run: cargo codspeed build --features num-bigint | |
| - name: Run the benchmarks | |
| uses: CodSpeedHQ/action@v5 | |
| with: | |
| mode: simulation | |
| run: cargo codspeed run |