Skip to content

Commit e3a636b

Browse files
committed
feat: add @codspeed/vitest-plugin and CodSpeed benchmarks workflow
1 parent 5487326 commit e3a636b

File tree

4 files changed

+309
-4
lines changed

4 files changed

+309
-4
lines changed

.github/workflows/codspeed.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CodSpeed Benchmarks
2+
3+
on:
4+
push:
5+
branches:
6+
- main # or "master"
7+
pull_request:
8+
# `workflow_dispatch` allows CodSpeed to trigger backtest
9+
# performance analysis in order to generate initial data.
10+
workflow_dispatch:
11+
12+
jobs:
13+
benchmarks:
14+
name: Run benchmarks
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: setup pnpm
20+
uses: pnpm/action-setup@v4
21+
22+
- name: setup node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: lts/*
26+
27+
- name: install dependencies
28+
run: pnpm install --frozen-lockfile
29+
30+
- name: build
31+
run: pnpm build
32+
33+
- name: run the benchmarks
34+
uses: CodSpeedHQ/action@v4
35+
with:
36+
mode: instrumentation
37+
run: pnpm -w bench

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
},
3838
"devDependencies": {
3939
"@clack/prompts": "catalog:",
40+
"@codspeed/vitest-plugin": "^5.0.1",
4041
"@deviltea/eslint-config": "catalog:",
4142
"@deviltea/tsconfig": "catalog:",
4243
"@types/node": "catalog:",

0 commit comments

Comments
 (0)