feat: migrate to criterion #7
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 Benchmarks | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| benchmarks: | |
| name: Run benchmarks | |
| runs-on: codspeed-macro | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/registry | |
| key: cargo-registry-${{ runner.arch }}-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| cargo-registry-${{ runner.arch }}- | |
| - name: Cache target directory | |
| uses: actions/cache@v4 | |
| with: | |
| path: target | |
| key: cargo-target-${{ runner.arch }}-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| cargo-target-${{ runner.arch }}- | |
| - name: Install cargo-codspeed | |
| run: cargo install cargo-codspeed --locked | |
| - name: Build benchmarks | |
| run: cargo codspeed build | |
| - name: Run benchmarks | |
| uses: CodSpeedHQ/action@v4 | |
| with: | |
| mode: walltime | |
| run: cargo codspeed run |