Skip to content

Commit

Permalink
chore: add codspeed
Browse files Browse the repository at this point in the history
  • Loading branch information
juno7803 committed Jun 17, 2024
1 parent e3dbe50 commit c268f06
Show file tree
Hide file tree
Showing 4 changed files with 246 additions and 44 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: codspeed-benchmarks

on:
push:
branches:
- "main"
pull_request:
workflow_dispatch:

jobs:
benchmarks:
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-node@v3"
- name: Install dependencies
run: yarn install
- name: Run benchmarks
uses: CodSpeedHQ/action@v2
with:
run: yarn exec vitest bench
token: ${{ secrets.CODSPEED_TOKEN }}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"@babel/preset-typescript": "^7.24.1",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@codspeed/vitest-plugin": "^3.1.0",
"@types/babel__core": "^7",
"@types/babel__preset-env": "^7",
"@types/broken-link-checker": "^0",
Expand All @@ -113,14 +114,15 @@
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"@vitest/coverage-istanbul": "^1.5.2",
"@vitest/ui": "^1.6.0",
"broken-link-checker": "^0.7.8",
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.5.0",
"lodash": "^4.17.21",
"prettier": "^3.2.5",
"tsup": "^8.1.0",
"typescript": "^5.4.5",
"vitest": "^1.5.2"
"vitest": "^1.6.0"
},
"sideEffects": false,
"scripts": {
Expand All @@ -130,4 +132,4 @@
"lint": "eslint ./src --ext .ts",
"format": "prettier --write ."
}
}
}
2 changes: 2 additions & 0 deletions vitest.config.mts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { defineConfig } from 'vitest/config';
import packageJson from './package.json';
import codspeedPlugin from '@codspeed/vitest-plugin';

export default defineConfig({
plugins: [codspeedPlugin],
test: {
name: packageJson.name,
coverage: {
Expand Down
Loading

0 comments on commit c268f06

Please sign in to comment.