1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Benchmarks
# spell-checker:ignore codspeed dtolnay Swatinem
on:
pull_request:
push:
branches:
- '*'
permissions:
contents: read # to fetch code (actions/checkout)
# End the current execution if there is a new changeset in the PR.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
benchmarks:
name: Run ${{ matrix.mode }} benchmarks (CodSpeed)
runs-on: ubuntu-latest
strategy:
matrix:
mode:
- simulation
- memory
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install cargo-codspeed
shell: bash
run: cargo install cargo-codspeed --locked
- name: Build benchmarks
shell: bash
run: cargo codspeed build
- name: Run benchmarks
uses: CodSpeedHQ/action@v4
env:
CODSPEED_LOG: debug
with:
mode: ${{ matrix.mode }}
run: cargo codspeed run > /dev/null
token: ${{ secrets.CODSPEED_TOKEN }}