Skip to content

Commit cee085e

Browse files
ci: add CodSpeed for continuous performance benchmarking (#24)
* Add CodSpeed for continuous performance benchmarking - Downgrade vitest from v4 to v3.2.4 for CodSpeed compatibility - Add @codspeed/vitest-plugin v5.0.1 - Configure vitest with CodSpeed plugin - Add GitHub Actions workflow for automated benchmarking - Add CodSpeed badge to README * Add CodSpeed configuration and workflow - Downgrade vitest from v4 to v3.2.4 for CodSpeed compatibility - Add @codspeed/vitest-plugin v5.0.1 - Configure vitest with CodSpeed plugin - Add GitHub Actions workflow for automated benchmarking - Add CodSpeed badge to README * Fix import order in vitest.config.ts * chore: rollback version * chore: pnpm lock --------- Co-authored-by: codspeed-hq[bot] <117304815+codspeed-hq[bot]@users.noreply.github.com> Co-authored-by: SerKo <serko.dev@gmail.com>
1 parent 6808e07 commit cee085e

File tree

7 files changed

+492
-86
lines changed

7 files changed

+492
-86
lines changed

.github/workflows/codspeed.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CodSpeed
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
id-token: write
13+
14+
jobs:
15+
benchmarks:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: pnpm/action-setup@v4
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 22
25+
cache: pnpm
26+
27+
- run: pnpm install --frozen-lockfile
28+
- run: pnpm run build
29+
30+
- name: Run benchmarks with CodSpeed
31+
uses: CodSpeedHQ/action@v4
32+
with:
33+
mode: simulation
34+
run: pnpm -F bench run bench --run

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![npm version][npm-version-src]][npm-version-href]
66
[![bundle][bundle-src]][bundle-href]
77
[![License][license-src]][license-href]
8+
[![CodSpeed][codspeed-src]][codspeed-href]
89

910
A TypeScript rewrite of [markdown-it](https://github.com/markdown-it/markdown-it) with first-class typings, modern tooling, and enhancements.
1011

@@ -122,3 +123,5 @@ This project owes its foundation to the [markdown-it](https://github.com/markdow
122123
[bundle-href]: https://bundlephobia.com/result?p=markdown-exit
123124
[license-src]: https://img.shields.io/github/license/serkodev/markdown-exit.svg?style=flat&colorA=00AF6B&colorB=000
124125
[license-href]: https://github.com/serkodev/markdown-exit/blob/main/LICENSE
126+
[codspeed-src]: https://img.shields.io/badge/CodSpeed-benchmark-blue
127+
[codspeed-href]: https://codspeed.io/serkodev/markdown-exit?utm_source=badge

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
"devDependencies": {
2222
"@antfu/eslint-config": "catalog:",
23+
"@codspeed/vitest-plugin": "catalog:tests",
2324
"@types/node": "catalog:types",
2425
"bumpp": "catalog:",
2526
"eslint": "catalog:",

packages/bench/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"bench": "vitest bench"
77
},
88
"devDependencies": {
9+
"@codspeed/vitest-plugin": "catalog:tests",
910
"@types/commonmark": "catalog:bench",
1011
"@types/markdown-it": "catalog:bench",
1112
"commonmark": "catalog:bench",

0 commit comments

Comments
 (0)