@@ -12,8 +12,26 @@ permissions:
1212
1313jobs :
1414 codspeed-instrumented :
15- name : Run CodSpeed instrumented
15+ name : Run CodSpeed instrumented (${{ matrix.plugin }})
1616 runs-on : " ubuntu-latest"
17+ strategy :
18+ fail-fast : false
19+ # Shard by plugin so the benchmark groups run in parallel instead of
20+ # sequentially. CodSpeed aggregates the per-shard uploads on the commit.
21+ matrix :
22+ include :
23+ - plugin : tinybench
24+ bench : |
25+ pnpm turbo run bench --filter=@codspeed/tinybench-plugin
26+ pnpm --workspace-concurrency 1 -r bench-tinybench
27+ - plugin : vitest
28+ bench : |
29+ pnpm turbo run bench --filter=@codspeed/vitest-plugin
30+ pnpm --workspace-concurrency 1 -r bench-vitest
31+ - plugin : benchmark.js
32+ bench : |
33+ pnpm turbo run bench --filter=@codspeed/benchmark.js-plugin
34+ pnpm --workspace-concurrency 1 -r bench-benchmark-js
1735 steps :
1836 - uses : " actions/checkout@v4"
1937 with :
@@ -24,32 +42,24 @@ jobs:
2442 with :
2543 cache : pnpm
2644 node-version-file : .nvmrc
45+ - name : Restore turbo cache
46+ uses : ./.github/actions/turbo-cache
47+ with :
48+ key-suffix : ${{ matrix.plugin }}
2749 - run : pnpm install --frozen-lockfile --prefer-offline
2850 - run : pnpm turbo run build
2951
3052 - name : Run simulation benchmarks
3153 uses : CodSpeedHQ/action@main
3254 with :
3355 mode : simulation
34- run : |
35- pnpm turbo run bench --filter=@codspeed/tinybench-plugin
36- pnpm turbo run bench --filter=@codspeed/vitest-plugin
37- pnpm turbo run bench --filter=@codspeed/benchmark.js-plugin
38- pnpm --workspace-concurrency 1 -r bench-tinybench
39- pnpm --workspace-concurrency 1 -r bench-benchmark-js
40- pnpm --workspace-concurrency 1 -r bench-vitest
56+ run : ${{ matrix.bench }}
4157
4258 - name : Run memory benchmarks
4359 uses : CodSpeedHQ/action@main
4460 with :
4561 mode : memory
46- run : |
47- pnpm turbo run bench --filter=@codspeed/tinybench-plugin
48- pnpm turbo run bench --filter=@codspeed/vitest-plugin
49- pnpm turbo run bench --filter=@codspeed/benchmark.js-plugin
50- pnpm --workspace-concurrency 1 -r bench-tinybench
51- pnpm --workspace-concurrency 1 -r bench-benchmark-js
52- pnpm --workspace-concurrency 1 -r bench-vitest
62+ run : ${{ matrix.bench }}
5363
5464 codspeed-walltime :
5565 name : Run CodSpeed walltime
6474 with :
6575 cache : pnpm
6676 node-version-file : .nvmrc
77+ - name : Restore turbo cache
78+ uses : ./.github/actions/turbo-cache
6779 - run : pnpm install --frozen-lockfile --prefer-offline
6880 - run : pnpm turbo run build
6981
@@ -101,6 +113,9 @@ jobs:
101113 node-version-file : .nvmrc
102114 cache : pnpm
103115
116+ - name : Restore turbo cache
117+ uses : ./.github/actions/turbo-cache
118+
104119 - name : Install repo dependencies
105120 run : pnpm install --frozen-lockfile --prefer-offline
106121
0 commit comments