Skip to content

Commit 7782de8

Browse files
committed
run the benchmark in the ci
1 parent 0a31731 commit 7782de8

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/benchmarks.yml

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

0 commit comments

Comments
 (0)