Open History to see the last commit
1# Setup taken from https://codspeed.io/docs/benchmarks/nodejs/vitest
2name: Benchmarks
3β
4on:
5 push:
6 # Broad on purpose: CodSpeed compares each PR against the run on its
7 # merge-base commit. Skipping main pushes that don't touch packages/**
8 # (pnpm config, CI, root tooling) leaves those commits without a baseline
9 # run, and CodSpeed silently falls back to an older, possibly outlier run β
10 # which then flags phantom regressions on every PR until the next eligible
11 # push. Only paths that cannot affect benchmark results are excluded.
12 branches:
13 - 'main'
14 paths-ignore:
15 - 'docs/**'
16 - 'examples/**'
17 - 'e2e/**'
18 pull_request:
19 paths:
20 - 'packages/**'
21 - '!packages/**/tests/**'
22 - '!packages/**/__tests__/**'
23 - '!packages/**/*.test.*'
24 - 'benchmarks/**'
25 - '.nvmrc'
26 workflow_dispatch:
27β
28concurrency:
29 group: benchmarks-${{ github.ref }}
30 cancel-in-progress: false
31 queue: single
32β
33permissions:
34 contents: read # required for actions/checkout
35 id-token: write # required for OIDC authentication with CodSpeed
36β
37env:
38 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
39 SERVER_PRESET: 'node-server'
40 NX_NO_CLOUD: true
41β
42jobs:
43 benchmarks:
44 name: Run ${{ matrix.benchmark }}:${{ matrix.framework }} CodSpeed benchmark
45 strategy:
46 fail-fast: false
47 matrix:
48 framework:
49 - react
50 - solid
51 - vue
52 benchmark:
53 - client-nav
54 - ssr
55 - memory-server
56 - memory-client
57 include:
58 - benchmark: client-nav
59 mode: simulation
60 - benchmark: ssr
61 mode: simulation
62 - benchmark: memory-server
63 mode: memory
64 - benchmark: memory-client
65 mode: memory
66 runs-on: ubuntu-latest
67 steps:
68 - name: Checkout
69 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
70 with:
71 persist-credentials: false
72β
73 - name: Setup Tools
74 uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
75β
76 # Run the build outside of the CodSpeed action to avoid being slowed by intrumentation overhead.
77 # (and then run the task itself with --excludeTaskDependencies)
78 - name: Prepare ${{ matrix.benchmark }}:${{ matrix.framework }} benchmark
79 run: >-
80 pnpm nx run
81 @benchmarks/${{ matrix.benchmark }}:build:${{ matrix.framework }}
82β
83 - name: Run ${{ matrix.benchmark }}:${{ matrix.framework }} CodSpeed benchmark
84 uses: CodSpeedHQ/action@373d6868929f444bc08d901fd0eb0ad52a8875ea # v5.2.1
85 timeout-minutes: 20
86 with:
87 mode: ${{ matrix.mode }}
88 run: >-
89 WITH_INSTRUMENTATION=1
90 pnpm nx run
91 @benchmarks/${{ matrix.benchmark }}:test:perf:${{ matrix.framework }}
92 --excludeTaskDependencies