Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

client-nav-benchmarks.yml

91 lines2.9 KB

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 workflow_dispatch:
26​
27concurrency:
28 group: client-nav-benchmarks-${{ github.ref }}
29 cancel-in-progress: false
30 queue: single
31​
32permissions:
33 contents: read # required for actions/checkout
34 id-token: write # required for OIDC authentication with CodSpeed
35​
36env:
37 NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
38 SERVER_PRESET: 'node-server'
39 NX_NO_CLOUD: true
40​
41jobs:
42 benchmarks:
43 name: Run ${{ matrix.benchmark }}:${{ matrix.framework }} CodSpeed benchmark
44 strategy:
45 fail-fast: false
46 matrix:
47 framework:
48 - react
49 - solid
50 - vue
51 benchmark:
52 - client-nav
53 - ssr
54 - memory-server
55 - memory-client
56 include:
57 - benchmark: client-nav
58 mode: simulation
59 - benchmark: ssr
60 mode: simulation
61 - benchmark: memory-server
62 mode: memory
63 - benchmark: memory-client
64 mode: memory
65 runs-on: ubuntu-latest
66 steps:
67 - name: Checkout
68 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
69 with:
70 persist-credentials: false
71​
72 - name: Setup Tools
73 uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
74​
75 # Run the build outside of the CodSpeed action to avoid being slowed by intrumentation overhead.
76 # (and then run the task itself with --excludeTaskDependencies)
77 - name: Prepare ${{ matrix.benchmark }}:${{ matrix.framework }} benchmark
78 run: >-
79 pnpm nx run
80 @benchmarks/${{ matrix.benchmark }}:build:${{ matrix.framework }}
81​
82 - name: Run ${{ matrix.benchmark }}:${{ matrix.framework }} CodSpeed benchmark
83 uses: CodSpeedHQ/action@373d6868929f444bc08d901fd0eb0ad52a8875ea # v5.2.1
84 timeout-minutes: 20
85 with:
86 mode: ${{ matrix.mode }}
87 run: >-
88 WITH_INSTRUMENTATION=1
89 pnpm nx run
90 @benchmarks/${{ matrix.benchmark }}:test:perf:${{ matrix.framework }}
91 --excludeTaskDependencies