From 8dbe2e7f8570502db680a87e6fbd6611f54db815 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sat, 27 Sep 2025 00:56:53 -0700 Subject: [PATCH] ci: add piscina to vendor test --- .github/workflows/update-vendor.yml | 1 + scripts/runner.node.mjs | 34 ++++++++++++++++++++--------- test/vendor.json | 6 +++++ 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/.github/workflows/update-vendor.yml b/.github/workflows/update-vendor.yml index 7e1ad4ec21..de43d8905b 100644 --- a/.github/workflows/update-vendor.yml +++ b/.github/workflows/update-vendor.yml @@ -16,6 +16,7 @@ jobs: matrix: package: - elysia + - piscina steps: - uses: actions/checkout@v4 diff --git a/scripts/runner.node.mjs b/scripts/runner.node.mjs index dac4df8028..1730ce22e1 100755 --- a/scripts/runner.node.mjs +++ b/scripts/runner.node.mjs @@ -639,7 +639,7 @@ async function runTests() { } if (vendorTests?.length) { - for (const { cwd: vendorPath, packageManager, testRunner, testPaths } of vendorTests) { + for (const { cwd: vendorPath, packageManager, testRunner, testPaths, build } of vendorTests) { if (!testPaths.length) { continue; } @@ -654,14 +654,15 @@ async function runTests() { throw new Error(`Unsupported package manager: ${packageManager}`); } - // build - const buildResult = await spawnBun(execPath, { - cwd: vendorPath, - args: ["run", "build"], - timeout: 60_000, - }); - if (!buildResult.ok) { - throw new Error(`Failed to build vendor: ${buildResult.error}`); + if (build) { + const buildResult = await spawnBun(execPath, { + cwd: vendorPath, + args: ["run", "build"], + timeout: 60_000, + }); + if (!buildResult.ok) { + throw new Error(`Failed to build vendor: ${buildResult.error}`); + } } for (const testPath of testPaths) { @@ -1651,6 +1652,7 @@ function getTests(cwd) { * @property {string} [testRunner] * @property {string[]} [testExtensions] * @property {boolean | Record} [skipTests] + * @property {boolean} [build] */ /** @@ -1659,6 +1661,7 @@ function getTests(cwd) { * @property {string} packageManager * @property {string} testRunner * @property {string[]} testPaths + * @property {boolean} build */ /** @@ -1693,7 +1696,17 @@ async function getVendorTests(cwd) { return Promise.all( relevantVendors.map( - async ({ package: name, repository, tag, testPath, testExtensions, testRunner, packageManager, skipTests }) => { + async ({ + package: name, + repository, + tag, + testPath, + testExtensions, + testRunner, + packageManager, + skipTests, + build, + }) => { const vendorPath = join(cwd, "vendor", name); if (!existsSync(vendorPath)) { @@ -1770,6 +1783,7 @@ async function getVendorTests(cwd) { packageManager: packageManager || "bun", testRunner: testRunner || "bun", testPaths, + build: build ?? true, }; }, ), diff --git a/test/vendor.json b/test/vendor.json index 79c1b1ffdc..0897fd1125 100644 --- a/test/vendor.json +++ b/test/vendor.json @@ -3,5 +3,11 @@ "package": "elysia", "repository": "https://github.com/elysiajs/elysia", "tag": "1.4.6" + }, + { + "package": "piscina", + "repository": "https://github.com/piscinajs/piscina", + "tag": "v5.1.3", + "build": false } ]