ci: add piscina to vendor test

This commit is contained in:
Meghan Denny
2025-09-27 00:56:53 -07:00
parent ba20670da3
commit 8dbe2e7f85
3 changed files with 31 additions and 10 deletions

View File

@@ -16,6 +16,7 @@ jobs:
matrix:
package:
- elysia
- piscina
steps:
- uses: actions/checkout@v4

View File

@@ -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<string, boolean | string>} [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,
};
},
),

View File

@@ -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
}
]