@@ -53,26 +53,38 @@ jobs:
5353 fetch-depth : 0
5454 submodules : true
5555 - uses : pnpm/action-setup@v2
56+ # First, build the entire monorepo with the development Node version (from .nvmrc)
5657 - uses : actions/setup-node@v3
5758 with :
5859 cache : pnpm
59- node-version : ${{ matrix.node-version }}
60+ node-version-file : .nvmrc
6061 - run : pnpm install --frozen-lockfile --prefer-offline
6162 - run : pnpm moon run :build
6263
64+ # Then, switch to the target Node version and test the examples
65+ - uses : actions/setup-node@v3
66+ with :
67+ cache : pnpm
68+ node-version : ${{ matrix.node-version }}
69+
70+ - name : Install example dependencies
71+ working-directory : examples/${{ matrix.example }}
72+ run : pnpm install --ignore-workspace
73+
6374 - name : Run benchmarks with tinybench-plugin
6475 # use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v2`
6576 uses : CodSpeedHQ/action@main
6677 with :
67- run : pnpm --filter ${{ matrix.example }} bench-tinybench
78+ run : cd examples/ ${{ matrix.example }} && pnpm bench-tinybench
6879 env :
6980 CODSPEED_SKIP_UPLOAD : true
7081 CODSPEED_DEBUG : true
82+
7183 - name : Run benchmarks with benchmark.js-plugin
7284 # use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v2`
7385 uses : CodSpeedHQ/action@main
7486 with :
75- run : pnpm --filter ${{ matrix.example }} bench-benchmark-js
87+ run : cd examples/ ${{ matrix.example }} && pnpm bench-benchmark-js
7688 env :
7789 CODSPEED_SKIP_UPLOAD : true
7890 CODSPEED_DEBUG : true
0 commit comments