Skip to content

Commit 018d3db

Browse files
committed
Add CodSpeed benchmarking with criterion2
1 parent 61f0fcf commit 018d3db

File tree

4 files changed

+522
-0
lines changed

4 files changed

+522
-0
lines changed

.github/workflows/benchmark.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Benchmark
2+
3+
permissions: {}
4+
5+
on:
6+
workflow_dispatch:
7+
pull_request:
8+
types: [opened, synchronize]
9+
paths:
10+
- "**/*.rs"
11+
- "Cargo.lock"
12+
- ".github/workflows/benchmark.yml"
13+
push:
14+
branches:
15+
- main
16+
paths:
17+
- "**/*.rs"
18+
- "Cargo.lock"
19+
- ".github/workflows/benchmark.yml"
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
benchmark:
27+
name: Benchmark
28+
runs-on: ubuntu-latest
29+
permissions:
30+
id-token: write
31+
steps:
32+
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
33+
34+
- uses: oxc-project/setup-rust@ecabb7322a2ba5aeedb3612d2a40b86a85cee235 # v1.0.11
35+
with:
36+
cache-key: benchmark
37+
save-cache: ${{ github.ref_name == 'main' }}
38+
tools: cargo-codspeed
39+
40+
- name: Build benchmark
41+
run: cargo codspeed build --features codspeed
42+
43+
- name: Run benchmark
44+
uses: CodSpeedHQ/action@bb005fe1c1eea036d3894f02c049cb6b154a1c27 # v4.3.3
45+
timeout-minutes: 15
46+
with:
47+
mode: instrumentation
48+
run: cargo codspeed run

0 commit comments

Comments
 (0)