Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ jobs:

node-versions:
runs-on: "ubuntu-latest"
name: "${{ matrix.example }} on Node ${{ matrix.node-version }}"
name: "Node ${{ matrix.node-version }} - ${{ matrix.example }}"
needs: list-examples
strategy:
matrix:
node-version: ["18", "20.5.1"]
node-version: ["20", "22", "24"]
example: ${{ fromJson(needs.list-examples.outputs.examples) }}
fail-fast: false
steps:
Expand All @@ -53,26 +53,38 @@ jobs:
fetch-depth: 0
submodules: true
- uses: pnpm/action-setup@v2
# First, build the entire monorepo with the development Node version (from .nvmrc)
- uses: actions/setup-node@v3
with:
cache: pnpm
node-version: ${{ matrix.node-version }}
node-version-file: .nvmrc
- run: pnpm install --frozen-lockfile --prefer-offline
- run: pnpm moon run :build

# Then, switch to the target Node version and test the examples
- uses: actions/setup-node@v3
with:
cache: pnpm
node-version: ${{ matrix.node-version }}

- name: Install example dependencies
working-directory: examples/${{ matrix.example }}
run: pnpm install --ignore-workspace

- name: Run benchmarks with tinybench-plugin
# use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v2`
uses: CodSpeedHQ/action@main
with:
run: pnpm --filter ${{ matrix.example }} bench-tinybench
run: cd examples/${{ matrix.example }} && pnpm bench-tinybench
env:
CODSPEED_SKIP_UPLOAD: true
CODSPEED_DEBUG: true

- name: Run benchmarks with benchmark.js-plugin
# use version from `main` branch to always test the latest version, in real projects, use a tag, like `@v2`
uses: CodSpeedHQ/action@main
with:
run: pnpm --filter ${{ matrix.example }} bench-benchmark-js
run: cd examples/${{ matrix.example }} && pnpm bench-benchmark-js
env:
CODSPEED_SKIP_UPLOAD: true
CODSPEED_DEBUG: true
2 changes: 1 addition & 1 deletion .moon/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $schema: "https://moonrepo.dev/schemas/toolchain.json"
node:
packageManager: "pnpm"
pnpm:
version: "10.12.4"
version: "10.15.0"

dedupeOnLockfileChange: false
dependencyVersionFormat: "workspace"
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.5.1
24.4.1
4 changes: 2 additions & 2 deletions examples/with-javascript-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"bench-tinybench": "node tinybench.js"
},
"devDependencies": {
"@codspeed/benchmark.js-plugin": "workspace:*",
"@codspeed/tinybench-plugin": "workspace:*",
"@codspeed/benchmark.js-plugin": "link:../../packages/benchmark.js-plugin",
"@codspeed/tinybench-plugin": "link:../../packages/tinybench-plugin",
"benchmark": "^2.1.4",
"tinybench": "^4.0.1"
}
Expand Down
10 changes: 5 additions & 5 deletions examples/with-typescript-cjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"name": "with-typescript-cjs",
"private": true,
"scripts": {
"bench-benchmark-js": "node -r esbuild-register bench/benchmark.js/index.bench.ts",
"bench-tinybench": "node -r esbuild-register bench/tinybench/index.bench.ts"
"bench-benchmark-js": "node --require tsx/cjs bench/benchmark.js/index.bench.ts",
"bench-tinybench": "node --require tsx/cjs bench/tinybench/index.bench.ts"
},
"devDependencies": {
"@codspeed/benchmark.js-plugin": "workspace:*",
"@codspeed/tinybench-plugin": "workspace:*",
"@codspeed/benchmark.js-plugin": "link:../../packages/benchmark.js-plugin",
"@codspeed/tinybench-plugin": "link:../../packages/tinybench-plugin",
"@types/benchmark": "^2.1.2",
"benchmark": "^2.1.4",
"esbuild-register": "^3.4.2",
"tsx": "^4.20.5",
"tinybench": "^4.0.1",
"typescript": "^5.1.3"
}
Expand Down
12 changes: 6 additions & 6 deletions examples/with-typescript-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"private": true,
"type": "module",
"scripts": {
"bench-benchmark-js": "node --loader esbuild-register/loader -r esbuild-register bench/benchmark.js/index.bench.ts",
"bench-tinybench": "node --loader esbuild-register/loader -r esbuild-register bench/tinybench/index.bench.ts",
"bench-benchmark-js": "node --import tsx/esm bench/benchmark.js/index.bench.ts",
"bench-tinybench": "node --import tsx/esm bench/tinybench/index.bench.ts",
"bench-vitest": "vitest bench --run"
},
"devDependencies": {
"@codspeed/benchmark.js-plugin": "workspace:*",
"@codspeed/tinybench-plugin": "workspace:*",
"@codspeed/vitest-plugin": "workspace:*",
"@codspeed/benchmark.js-plugin": "link:../../packages/benchmark.js-plugin",
"@codspeed/tinybench-plugin": "link:../../packages/tinybench-plugin",
"@codspeed/vitest-plugin": "link:../../packages/vitest-plugin",
"@types/benchmark": "^2.1.2",
"benchmark": "^2.1.4",
"esbuild-register": "^3.4.2",
"tinybench": "^4.0.1",
"tsx": "^4.20.5",
"typescript": "^5.1.3",
"vitest": "^3.2.4"
}
Expand Down
Loading
Loading