Skip to content

Commit 5cb3bec

Browse files
authored
Update codspeed.yml
Signed-off-by: Mustapha BARKI <code4yo@gmail.com>
1 parent 232b08d commit 5cb3bec

File tree

1 file changed

+33
-18
lines changed

1 file changed

+33
-18
lines changed

.github/workflows/codspeed.yml

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,45 @@
1-
name: CodSpeed
1+
name: CodSpeed Benchmarks
22

3+
# trigger on manual dispatch, pushes to canary, and daily schedule
34
on:
4-
# Run on pushes to the main branch
5+
workflow_dispatch:
56
push:
67
branches:
7-
- "main" # or "master"
8-
# Run on pull requests
9-
pull_request:
10-
# `workflow_dispatch` allows CodSpeed to trigger backtest
11-
# performance analysis in order to generate initial data.
12-
workflow_dispatch:
8+
- canary
9+
schedule:
10+
- cron: '0 5 * * *' # every day at 05:00 UTC
1311

1412
jobs:
15-
benchmarks:
16-
name: Run benchmarks
13+
benchmark:
1714
runs-on: ubuntu-latest
1815
steps:
16+
# 1. checkout your code
1917
- uses: actions/checkout@v4
20-
# ...
21-
# Setup your environment here:
22-
# - Configure your Python/Rust/Node version
23-
# - Install your dependencies
24-
# - Build your benchmarks (if using a compiled language)
25-
# ...
18+
19+
# 2. ensure Node is available
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: '18'
24+
25+
# 3. install dependencies (adjust if you use npm/yarn)
26+
- name: Install dependencies
27+
run: pnpm install
28+
shell: bash
29+
30+
# 4. install the CodSpeed runner (pins v3.5.0)
31+
- name: Install CodSpeed runner
32+
run: |
33+
curl -fsSL https://github.com/CodSpeedHQ/runner/releases/download/v3.5.0/codspeed-runner-installer.sh \
34+
| dos2unix \
35+
| bash
36+
shell: bash
37+
env:
38+
CODSPEED_RUNNER_VERSION: '3.5.0'
39+
40+
# 5. actually run your benchmarks
2641
- name: Run benchmarks
2742
uses: CodSpeedHQ/action@v3
2843
with:
29-
token: ${{ secrets.CODSPEED_TOKEN }}
30-
run: "<Insert your benchmark command here>"
44+
version: '3.5.0'
45+
args: 'pnpm vitest bench --reporter=dot'

0 commit comments

Comments
 (0)