From 208b97cc1d3c5f32d160aeeb832958867dd4bf3e Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Wed, 22 Apr 2026 06:31:02 +0800 Subject: [PATCH 01/24] Switch to all.mjs --- package.json | 6 +++--- test/{all.js => all.mjs} | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename test/{all.js => all.mjs} (100%) diff --git a/package.json b/package.json index 4848a184..fdb62f41 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "scripts": { "format": "prettier --write .", "lint": "prettier --check . && lunte", - "test": "brittle test/all.js", - "test:bare": "bare test/all.js", - "test:generate": "brittle -r test/all.js test/*.js" + "test": "brittle test/all.mjs", + "test:bare": "bare test/all.mjs", + "test:generate": "brittle -r test/all.mjs test/*.js" }, "repository": { "type": "git", diff --git a/test/all.js b/test/all.mjs similarity index 100% rename from test/all.js rename to test/all.mjs From 9dc8e00b1248699da6c411f5f08f1e05cc61962b Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Wed, 22 Apr 2026 06:33:46 +0800 Subject: [PATCH 02/24] Use load() to load test files --- test/all.mjs | 62 ++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/test/all.mjs b/test/all.mjs index 40c818d2..f17b5019 100644 --- a/test/all.mjs +++ b/test/all.mjs @@ -7,37 +7,37 @@ async function runTests() { test.pause() - await import('./atomic.js') - await import('./basic.js') // todo: implement storageInfo API - await import('./batch.js') - await import('./bit-interlude.js') - await import('./bitfield.js') - await import('./clear.js') // todo: replace Info.bytesUsed API - // await import('./compat.js') // todo: how to test compat? - await import('./conflicts.js') - await import('./core.js') - await import('./encodings.js') - await import('./encryption.js') - await import('./extension.js') - await import('./fully-remote-proof.js') - await import('./manifest.js') - await import('./mark-n-sweep.js') - await import('./merkle-tree.js') - await import('./merkle-tree-recovery.js') - await import('./move-to.js') - await import('./mutex.js') - await import('./preload.js') - // await import('./purge.js') // todo: implement purge - await import('./push.js') - await import('./remote-bitfield.js') - await import('./remote-length.js') - await import('./replicate.js') - await import('./sessions.js') - await import('./snapshots.js') - await import('./streams.js') - await import('./timeouts.js') - await import('./user-data.js') - await import('./wants.js') + await test.load(import.meta.resolve('./atomic.js')) + await test.load(import.meta.resolve('./basic.js')) // todo: implement storageInfo API + await test.load(import.meta.resolve('./batch.js')) + await test.load(import.meta.resolve('./bit-interlude.js')) + await test.load(import.meta.resolve('./bitfield.js')) + await test.load(import.meta.resolve('./clear.js')) // todo: replace Info.bytesUsed API + // await test.load(import.meta.resolve('./compat.js')) // todo: how to test compat? + await test.load(import.meta.resolve('./conflicts.js')) + await test.load(import.meta.resolve('./core.js')) + await test.load(import.meta.resolve('./encodings.js')) + await test.load(import.meta.resolve('./encryption.js')) + await test.load(import.meta.resolve('./extension.js')) + await test.load(import.meta.resolve('./fully-remote-proof.js')) + await test.load(import.meta.resolve('./manifest.js')) + await test.load(import.meta.resolve('./mark-n-sweep.js')) + await test.load(import.meta.resolve('./merkle-tree.js')) + await test.load(import.meta.resolve('./merkle-tree-recovery.js')) + await test.load(import.meta.resolve('./move-to.js')) + await test.load(import.meta.resolve('./mutex.js')) + await test.load(import.meta.resolve('./preload.js')) + // await test.load(import.meta.resolve('./purge.js')) // todo: implement purge + await test.load(import.meta.resolve('./push.js')) + await test.load(import.meta.resolve('./remote-bitfield.js')) + await test.load(import.meta.resolve('./remote-length.js')) + await test.load(import.meta.resolve('./replicate.js')) + await test.load(import.meta.resolve('./sessions.js')) + await test.load(import.meta.resolve('./snapshots.js')) + await test.load(import.meta.resolve('./streams.js')) + await test.load(import.meta.resolve('./timeouts.js')) + await test.load(import.meta.resolve('./user-data.js')) + await test.load(import.meta.resolve('./wants.js')) test.resume() } From 07ceab62eb36b3d704f2f63de7ab1dd58f57ce9c Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Wed, 22 Apr 2026 06:34:49 +0800 Subject: [PATCH 03/24] Switch commands to v4 --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index fdb62f41..4486a422 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "scripts": { "format": "prettier --write .", "lint": "prettier --check . && lunte", - "test": "brittle test/all.mjs", - "test:bare": "bare test/all.mjs", - "test:generate": "brittle -r test/all.mjs test/*.js" + "test": "brittle-node test/all.mjs", + "test:bare": "brittle-bare test/all.mjs", + "test:generate": "brittle-make-test test/all.mjs test/*.js" }, "repository": { "type": "git", @@ -67,7 +67,7 @@ "z32": "^1.0.0" }, "devDependencies": { - "brittle": "^3.0.0", + "brittle": "^4.0.0-rc.0", "debugging-stream": "^3.1.0", "hyperswarm": "^4.3.6", "lunte": "^1.3.0", From 7f9f071f932bbdfbf5fd242f44757d3ec503ba94 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Wed, 22 Apr 2026 08:32:00 +0800 Subject: [PATCH 04/24] Use -j 8 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4486a422..f688ca4f 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "scripts": { "format": "prettier --write .", "lint": "prettier --check . && lunte", - "test": "brittle-node test/all.mjs", - "test:bare": "brittle-bare test/all.mjs", + "test": "brittle-node -j 8 test/all.mjs", + "test:bare": "brittle-bare -j 8 test/all.mjs", "test:generate": "brittle-make-test test/all.mjs test/*.js" }, "repository": { From 43f70a3178260e39788fcf0a41cf39212b402274 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Wed, 22 Apr 2026 09:28:53 +0800 Subject: [PATCH 05/24] Reduce to 4 jobs --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f688ca4f..b6a7a346 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "scripts": { "format": "prettier --write .", "lint": "prettier --check . && lunte", - "test": "brittle-node -j 8 test/all.mjs", - "test:bare": "brittle-bare -j 8 test/all.mjs", + "test": "brittle-node -j 4 test/all.mjs", + "test:bare": "brittle-bare -j 4 test/all.mjs", "test:generate": "brittle-make-test test/all.mjs test/*.js" }, "repository": { From 7276fdf3c2e09bcc68a5acd211746c4df64f5c03 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Thu, 23 Apr 2026 01:28:48 +0800 Subject: [PATCH 06/24] Temporarily add logging of cpu cores --- .github/workflows/test-node.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml index 1a0b3a7f..8d0014a9 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/test-node.yml @@ -33,6 +33,7 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm install - run: npm test + - run: echo "Running on $(nproc) cores" - run: npm -g install bare - run: npm run test:bare trigger_canary: From 08b1243081479e2e5f34aa201d3b4af2fc5a2481 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Thu, 23 Apr 2026 02:01:33 +0800 Subject: [PATCH 07/24] Revert "Temporarily add logging of cpu cores" This reverts commit 7276fdf3c2e09bcc68a5acd211746c4df64f5c03. --- .github/workflows/test-node.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml index 8d0014a9..1a0b3a7f 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/test-node.yml @@ -33,7 +33,6 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm install - run: npm test - - run: echo "Running on $(nproc) cores" - run: npm -g install bare - run: npm run test:bare trigger_canary: From d6a635561cc2088728b8d8aae24153d2e3b65f42 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Thu, 23 Apr 2026 08:52:39 +0800 Subject: [PATCH 08/24] Remove -j from node --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b6a7a346..2aecc5d0 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "format": "prettier --write .", "lint": "prettier --check . && lunte", - "test": "brittle-node -j 4 test/all.mjs", + "test": "brittle-node test/all.mjs", "test:bare": "brittle-bare -j 4 test/all.mjs", "test:generate": "brittle-make-test test/all.mjs test/*.js" }, From df2bc9982880ba67e5c456cdf6642f07d2e485e1 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Thu, 23 Apr 2026 21:45:08 +0800 Subject: [PATCH 09/24] Use a separate command for parallel tests --- .github/workflows/test-node.yml | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml index 1a0b3a7f..c8828ee4 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/test-node.yml @@ -34,7 +34,7 @@ jobs: - run: npm install - run: npm test - run: npm -g install bare - - run: npm run test:bare + - run: npm run test:bare:parallel trigger_canary: if: startsWith(github.ref, 'refs/tags/') # Only run when a new package is published (detects when a new tag is pushed) runs-on: ubuntu-latest diff --git a/package.json b/package.json index 2aecc5d0..d6efa189 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "format": "prettier --write .", "lint": "prettier --check . && lunte", "test": "brittle-node test/all.mjs", - "test:bare": "brittle-bare -j 4 test/all.mjs", + "test:bare": "brittle-bare test/all.mjs", + "test:bare:parallel": "brittle-bare -j 4 test/all.mjs", "test:generate": "brittle-make-test test/all.mjs test/*.js" }, "repository": { From 24703eda9f8e67f8fdd2746f9e8659078ec1a914 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Fri, 24 Apr 2026 04:48:19 +0800 Subject: [PATCH 10/24] Revert "Use a separate command for parallel tests" This reverts commit df2bc9982880ba67e5c456cdf6642f07d2e485e1. --- .github/workflows/test-node.yml | 2 +- package.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml index c8828ee4..1a0b3a7f 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/test-node.yml @@ -34,7 +34,7 @@ jobs: - run: npm install - run: npm test - run: npm -g install bare - - run: npm run test:bare:parallel + - run: npm run test:bare trigger_canary: if: startsWith(github.ref, 'refs/tags/') # Only run when a new package is published (detects when a new tag is pushed) runs-on: ubuntu-latest diff --git a/package.json b/package.json index d6efa189..2aecc5d0 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,7 @@ "format": "prettier --write .", "lint": "prettier --check . && lunte", "test": "brittle-node test/all.mjs", - "test:bare": "brittle-bare test/all.mjs", - "test:bare:parallel": "brittle-bare -j 4 test/all.mjs", + "test:bare": "brittle-bare -j 4 test/all.mjs", "test:generate": "brittle-make-test test/all.mjs test/*.js" }, "repository": { From fc078a4b8682fe60cd62a543f72532d129d5eae6 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Fri, 24 Apr 2026 04:49:42 +0800 Subject: [PATCH 11/24] Use test:node as script --- .github/workflows/test-node.yml | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml index 1a0b3a7f..d87f2f6c 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/test-node.yml @@ -32,7 +32,7 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm install - - run: npm test + - run: npm run test:node - run: npm -g install bare - run: npm run test:bare trigger_canary: diff --git a/package.json b/package.json index 2aecc5d0..393744d4 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "format": "prettier --write .", "lint": "prettier --check . && lunte", - "test": "brittle-node test/all.mjs", + "test": "npm run test:node && npm run test:bare", + "test:node": "brittle-node test/all.mjs", "test:bare": "brittle-bare -j 4 test/all.mjs", "test:generate": "brittle-make-test test/all.mjs test/*.js" }, From 43c8bd0346873ff0c00cde2e11228e15bdaa1e12 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Fri, 24 Apr 2026 06:43:11 +0800 Subject: [PATCH 12/24] Test with 1 thread --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 393744d4..df12d5f2 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "lint": "prettier --check . && lunte", "test": "npm run test:node && npm run test:bare", "test:node": "brittle-node test/all.mjs", - "test:bare": "brittle-bare -j 4 test/all.mjs", + "test:bare": "brittle-bare -j 1 test/all.mjs", "test:generate": "brittle-make-test test/all.mjs test/*.js" }, "repository": { From f07fd316b0fdd52a20dcd82c462cc11bf2b9fb40 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Fri, 24 Apr 2026 06:43:25 +0800 Subject: [PATCH 13/24] Test with 2 threads --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index df12d5f2..c58dacec 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "lint": "prettier --check . && lunte", "test": "npm run test:node && npm run test:bare", "test:node": "brittle-node test/all.mjs", - "test:bare": "brittle-bare -j 1 test/all.mjs", + "test:bare": "brittle-bare -j 2 test/all.mjs", "test:generate": "brittle-make-test test/all.mjs test/*.js" }, "repository": { From 2154951928a8602d1f0c47a9650f5d2cb5b98f3a Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Fri, 24 Apr 2026 06:44:02 +0800 Subject: [PATCH 14/24] Test with 3 threads --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c58dacec..7c3deb9f 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "lint": "prettier --check . && lunte", "test": "npm run test:node && npm run test:bare", "test:node": "brittle-node test/all.mjs", - "test:bare": "brittle-bare -j 2 test/all.mjs", + "test:bare": "brittle-bare -j 3 test/all.mjs", "test:generate": "brittle-make-test test/all.mjs test/*.js" }, "repository": { From c76f0faf3ad91f35e258d3c35f36760a36a2e862 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Fri, 24 Apr 2026 07:17:14 +0800 Subject: [PATCH 15/24] Test with 4 threads --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7c3deb9f..393744d4 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "lint": "prettier --check . && lunte", "test": "npm run test:node && npm run test:bare", "test:node": "brittle-node test/all.mjs", - "test:bare": "brittle-bare -j 3 test/all.mjs", + "test:bare": "brittle-bare -j 4 test/all.mjs", "test:generate": "brittle-make-test test/all.mjs test/*.js" }, "repository": { From 7a37592089fede4439f2a5c46a536216509b2de9 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Fri, 24 Apr 2026 07:17:29 +0800 Subject: [PATCH 16/24] Test with 6 threads --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 393744d4..3f7cb5e3 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "lint": "prettier --check . && lunte", "test": "npm run test:node && npm run test:bare", "test:node": "brittle-node test/all.mjs", - "test:bare": "brittle-bare -j 4 test/all.mjs", + "test:bare": "brittle-bare -j 6 test/all.mjs", "test:generate": "brittle-make-test test/all.mjs test/*.js" }, "repository": { From 80bb5a67d335397947adade320ff8ff932a3f959 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Fri, 24 Apr 2026 07:17:39 +0800 Subject: [PATCH 17/24] Test with 6 threads --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3f7cb5e3..d3d826e4 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "lint": "prettier --check . && lunte", "test": "npm run test:node && npm run test:bare", "test:node": "brittle-node test/all.mjs", - "test:bare": "brittle-bare -j 6 test/all.mjs", + "test:bare": "brittle-bare -j 8 test/all.mjs", "test:generate": "brittle-make-test test/all.mjs test/*.js" }, "repository": { From 451608a3c781fe8b7cad1712465b7a6594d928e8 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Fri, 24 Apr 2026 09:21:29 +0800 Subject: [PATCH 18/24] Switch to v4 debug --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d3d826e4..2fce7494 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "z32": "^1.0.0" }, "devDependencies": { - "brittle": "^4.0.0-rc.0", + "brittle": "github:holepunchto/brittle#v4-debug", "debugging-stream": "^3.1.0", "hyperswarm": "^4.3.6", "lunte": "^1.3.0", From a0eeaa080743670b54c4585a8c1e01fbf444e458 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Fri, 24 Apr 2026 22:28:29 +0800 Subject: [PATCH 19/24] Increase timeout of marking tests --- test/mark-n-sweep.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/mark-n-sweep.js b/test/mark-n-sweep.js index 6000322d..ed84b5ef 100644 --- a/test/mark-n-sweep.js +++ b/test/mark-n-sweep.js @@ -3,7 +3,7 @@ const { create, createStorage } = require('./helpers') const Hypercore = require('../') -test('startMarking - basic', async (t) => { +test('startMarking - basic', { timeout: 60_000 }, async (t) => { const core = await create(t) const num = 50_000 @@ -90,7 +90,7 @@ test('startMarking then immediate sweep', async (t) => { t.absent(await core.has(0, core.length), 'cleared all blocks') }) -test('startMarking - on session', async (t) => { +test('startMarking - on session', { timeout: 60_000 }, async (t) => { const core = await create(t) const num = 50_000 From 9a4e3f19323470f301605998d2cd924cd3492421 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Wed, 29 Apr 2026 10:02:53 +0800 Subject: [PATCH 20/24] Use 4 jobs by default --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2fce7494..aeab50d8 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "lint": "prettier --check . && lunte", "test": "npm run test:node && npm run test:bare", "test:node": "brittle-node test/all.mjs", - "test:bare": "brittle-bare -j 8 test/all.mjs", + "test:bare": "brittle-bare -j 4 test/all.mjs", "test:generate": "brittle-make-test test/all.mjs test/*.js" }, "repository": { From 2ee875a50b92dd4ff3bb5cf93df0c8053ea4086b Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Wed, 29 Apr 2026 10:03:12 +0800 Subject: [PATCH 21/24] Use brittle v4 branch --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aeab50d8..4fd5a06d 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "z32": "^1.0.0" }, "devDependencies": { - "brittle": "github:holepunchto/brittle#v4-debug", + "brittle": "github:holepunchto/brittle#v4", "debugging-stream": "^3.1.0", "hyperswarm": "^4.3.6", "lunte": "^1.3.0", From 60e638f1508ff49d1b7dd86c12fbabc1353af8b5 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Wed, 29 Apr 2026 12:06:42 +0800 Subject: [PATCH 22/24] Split workflows into multiple files --- .github/workflows/canary.yml | 19 +++++++++ .github/workflows/lint.yml | 16 ++++++++ .github/workflows/test-bare.yml | 34 ++++++++++++++++ .github/workflows/test-node.yml | 70 ++++++++++++++------------------- 4 files changed, 99 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/canary.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/test-bare.yml diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml new file mode 100644 index 00000000..4eaea94b --- /dev/null +++ b/.github/workflows/canary.yml @@ -0,0 +1,19 @@ +name: Run Canary +on: + push: + tags: + - '*' + +jobs: + trigger_canary: + if: startsWith(github.ref, 'refs/tags/') # Only run when a new package is published (detects when a new tag is pushed) + runs-on: ubuntu-latest + steps: + - name: trigger canary + run: | + curl -L -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.CANARY_DISPATCH_PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/holepunchto/canary-tests/dispatches \ + -d '{"event_type":"triggered-by-${{ github.event.repository.name }}-${{ github.ref_name }}"}' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..d55b770c --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,16 @@ +name: Lint + +on: + push: + branches: [main, rocksdb] + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + name: Lint + steps: + - uses: holepunchto/actions/node-base@v1 + with: + allow-git: true + - run: npm run lint diff --git a/.github/workflows/test-bare.yml b/.github/workflows/test-bare.yml new file mode 100644 index 00000000..ec2a9064 --- /dev/null +++ b/.github/workflows/test-bare.yml @@ -0,0 +1,34 @@ +name: Test with Bare + +on: + push: + branches: [main, rocksdb] + pull_request: + +jobs: + test: + strategy: + matrix: + include: + - os: ubuntu-latest + platform: linux + arch: x64 + + - os: macos-latest + platform: darwin + arch: x64 + + - os: windows-latest + platform: win32 + arch: x64 + + runs-on: ${{ matrix.os }} + name: ${{ matrix.platform }}-${{ matrix.arch }} + steps: + - uses: holepunchto/actions/node-base@v1 + with: + allow-git: true + - uses: holepunchto/actions/setup-bare@v1 + + - name: Run tests + run: npm run test:bare diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml index d87f2f6c..51ea7daa 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/test-node.yml @@ -1,49 +1,39 @@ -name: Build Status +name: Test with Node + on: push: - branches: - - main - - rocksdb - tags: # To trigger the canary - - '*' + branches: [main, rocksdb] pull_request: - branches: - - main - - rocksdb + jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 https://github.com/actions/checkout/releases/tag/v4.1.1 - - uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2 https://github.com/actions/setup-node/releases/tag/v3.8.2 - - run: npm install - - run: npm run lint - build: - if: ${{ !startsWith(github.ref, 'refs/tags/')}} # Already runs for the push of the commit, no need to run again for the tag + test: strategy: matrix: - node-version: [lts/*] - os: [ubuntu-latest, macos-latest, windows-latest] + include: + - os: ubuntu-latest + platform: linux + arch: x64 + + - os: macos-latest + platform: darwin + arch: x64 + + - os: windows-latest + platform: win32 + arch: x64 + runs-on: ${{ matrix.os }} + name: ${{ matrix.platform }}-${{ matrix.arch }} steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 https://github.com/actions/checkout/releases/tag/v4.1.1 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2 https://github.com/actions/setup-node/releases/tag/v3.8.2 + - uses: holepunchto/actions/node-base@v1 with: - node-version: ${{ matrix.node-version }} - - run: npm install - - run: npm run test:node - - run: npm -g install bare - - run: npm run test:bare - trigger_canary: - if: startsWith(github.ref, 'refs/tags/') # Only run when a new package is published (detects when a new tag is pushed) - runs-on: ubuntu-latest - steps: - - name: trigger canary - run: | - curl -L -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.CANARY_DISPATCH_PAT }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/holepunchto/canary-tests/dispatches \ - -d '{"event_type":"triggered-by-${{ github.event.repository.name }}-${{ github.ref_name }}"}' + allow-git: true + + - name: Run tests + run: npm run test:node + + - name: Run tests (encrypt all) + run: npm run test:node -- --encrypt-all + + - name: Run tests (fixtures) + run: npm run test:fixtures From 6f1e4b7995427506ade0994ff6e577f33bf1d11c Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Wed, 29 Apr 2026 12:19:50 +0800 Subject: [PATCH 23/24] Remove excess commands --- .github/workflows/test-node.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml index 51ea7daa..f7eaaf25 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/test-node.yml @@ -31,9 +31,3 @@ jobs: - name: Run tests run: npm run test:node - - - name: Run tests (encrypt all) - run: npm run test:node -- --encrypt-all - - - name: Run tests (fixtures) - run: npm run test:fixtures From 6daca4d27efc5ff4243c626c791a8ceaaa0f1739 Mon Sep 17 00:00:00 2001 From: Jan Keith Darunday Date: Wed, 29 Apr 2026 12:22:56 +0800 Subject: [PATCH 24/24] Add missing await --- test/all.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/all.mjs b/test/all.mjs index f17b5019..7ab7f679 100644 --- a/test/all.mjs +++ b/test/all.mjs @@ -1,6 +1,6 @@ // This runner is auto-generated by Brittle -runTests() +await runTests() async function runTests() { const test = (await import('brittle')).default