File tree Expand file tree Collapse file tree
packages/vitest-plugin/benches Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8787 env :
8888 CODSPEED_SKIP_UPLOAD : true
8989 CODSPEED_DEBUG : true
90-
91- walltime-macos-test :
92- runs-on : macos-latest
93- steps :
94- - uses : " actions/checkout@v4"
95- with :
96- fetch-depth : 0
97- submodules : true
98- - uses : pnpm/action-setup@v2
99- - uses : actions/setup-node@v3
100- with :
101- cache : pnpm
102- node-version-file : .nvmrc
103- - name : Restore turbo cache
104- uses : ./.github/actions/turbo-cache
105- - run : pnpm install --frozen-lockfile --prefer-offline
106- - run : pnpm turbo run build
107-
108- - name : Run benchmarks
109- uses : CodSpeedHQ/action@main
110- env :
111- CODSPEED_SKIP_UPLOAD : " true"
112- # Samply fails to profile pnpm targets for now
113- CODSPEED_PROFILER_ENABLED : " false"
114- with :
115- run : pnpm turbo run bench --filter=@codspeed/vitest-plugin
116- mode : walltime
Original file line number Diff line number Diff line change 9191 pnpm --workspace-concurrency 1 -r bench-tinybench
9292 pnpm --workspace-concurrency 1 -r bench-vitest
9393
94+ codspeed-walltime-macos :
95+ runs-on : macos-latest
96+ steps :
97+ - uses : " actions/checkout@v4"
98+ with :
99+ fetch-depth : 0
100+ submodules : true
101+ - uses : pnpm/action-setup@v2
102+ - uses : actions/setup-node@v3
103+ with :
104+ cache : pnpm
105+ node-version-file : .nvmrc
106+ - name : Restore turbo cache
107+ uses : ./.github/actions/turbo-cache
108+ - run : pnpm install --frozen-lockfile --prefer-offline
109+ - run : pnpm turbo run build
110+
111+ - name : Run macOS-only benchmarks
112+ uses : CodSpeedHQ/action@main
113+ with :
114+ working-directory : packages/vitest-plugin
115+ # Only run the macOS-only bench file: the rest of the suite already
116+ # runs on the linux walltime job, and uploading the same benchmark
117+ # twice for one commit is not supported.
118+ run : pnpm turbo run bench --env-mode=loose --filter=@codspeed/vitest-plugin -- macos
119+ mode : walltime
120+ runner-version : branch:sip-resign-exec-redirect
121+
94122 electron-e2e :
95123 name : Run electron inbox e2e
96124 runs-on : codspeed-macro
Original file line number Diff line number Diff line change 1+ import { bench , describe } from "vitest" ;
2+
3+ const isMacOS = process . platform === "darwin" ;
4+
5+ function fibo ( n : number ) : number {
6+ if ( n < 2 ) return 1 ;
7+ return fibo ( n - 1 ) + fibo ( n - 2 ) ;
8+ }
9+
10+ // macOS-only benchmark: skipped on every other platform, so it only runs on
11+ // the `codspeed-walltime-macos` CI job (see .github/workflows/codspeed.yml).
12+ describe . skipIf ( ! isMacOS ) ( "macos only" , ( ) => {
13+ bench ( "fibo darwin" , ( ) => {
14+ fibo ( 30 ) ;
15+ } ) ;
16+ } ) ;
You can’t perform that action at this time.
0 commit comments