diff --git a/.github/swc-ecosystem-ci/todos/bunchee.ts b/.github/swc-ecosystem-ci/tests/bunchee.ts similarity index 83% rename from .github/swc-ecosystem-ci/todos/bunchee.ts rename to .github/swc-ecosystem-ci/tests/bunchee.ts index 8d405f0fc644..1b7f8306f7ab 100644 --- a/.github/swc-ecosystem-ci/todos/bunchee.ts +++ b/.github/swc-ecosystem-ci/tests/bunchee.ts @@ -6,7 +6,7 @@ export async function test(options: RunOptions) { ...options, repo: "huozhi/bunchee", branch: "main", - build: "build", - test: ["test"], + // build: "build", + test: ["test:ci"], }); } diff --git a/.github/swc-ecosystem-ci/todos/graphql-yoga.ts b/.github/swc-ecosystem-ci/tests/graphql-yoga.ts similarity index 100% rename from .github/swc-ecosystem-ci/todos/graphql-yoga.ts rename to .github/swc-ecosystem-ci/tests/graphql-yoga.ts diff --git a/.github/swc-ecosystem-ci/todos/react-joyride.ts b/.github/swc-ecosystem-ci/tests/react-joyride.ts similarity index 100% rename from .github/swc-ecosystem-ci/todos/react-joyride.ts rename to .github/swc-ecosystem-ci/tests/react-joyride.ts diff --git a/.github/swc-ecosystem-ci/todos/react-leaflet.ts b/.github/swc-ecosystem-ci/tests/react-leaflet.ts similarity index 100% rename from .github/swc-ecosystem-ci/todos/react-leaflet.ts rename to .github/swc-ecosystem-ci/tests/react-leaflet.ts diff --git a/.github/swc-ecosystem-ci/todos/swc-plugin-vue-jsx.ts b/.github/swc-ecosystem-ci/tests/swc-plugin-vue-jsx.ts similarity index 100% rename from .github/swc-ecosystem-ci/todos/swc-plugin-vue-jsx.ts rename to .github/swc-ecosystem-ci/tests/swc-plugin-vue-jsx.ts diff --git a/.github/swc-ecosystem-ci/todos/swr.ts b/.github/swc-ecosystem-ci/tests/swr.ts similarity index 100% rename from .github/swc-ecosystem-ci/todos/swr.ts rename to .github/swc-ecosystem-ci/tests/swr.ts diff --git a/.github/swc-ecosystem-ci/todos/tldraw.ts b/.github/swc-ecosystem-ci/tests/tldraw.ts similarity index 100% rename from .github/swc-ecosystem-ci/todos/tldraw.ts rename to .github/swc-ecosystem-ci/tests/tldraw.ts diff --git a/.github/swc-ecosystem-ci/todos/umi.ts b/.github/swc-ecosystem-ci/tests/umi.ts similarity index 100% rename from .github/swc-ecosystem-ci/todos/umi.ts rename to .github/swc-ecosystem-ci/tests/umi.ts diff --git a/.github/swc-ecosystem-ci/todos/unblock-netease-music.ts b/.github/swc-ecosystem-ci/tests/unblock-netease-music.ts similarity index 100% rename from .github/swc-ecosystem-ci/todos/unblock-netease-music.ts rename to .github/swc-ecosystem-ci/tests/unblock-netease-music.ts diff --git a/.github/swc-ecosystem-ci/tests/medusa.ts b/.github/swc-ecosystem-ci/todos/medusa.ts similarity index 100% rename from .github/swc-ecosystem-ci/tests/medusa.ts rename to .github/swc-ecosystem-ci/todos/medusa.ts diff --git a/.github/swc-ecosystem-ci/tests/react-dnd.ts b/.github/swc-ecosystem-ci/todos/react-dnd.ts similarity index 91% rename from .github/swc-ecosystem-ci/tests/react-dnd.ts rename to .github/swc-ecosystem-ci/todos/react-dnd.ts index 723fc8c5e48e..b0efdf51507f 100644 --- a/.github/swc-ecosystem-ci/tests/react-dnd.ts +++ b/.github/swc-ecosystem-ci/todos/react-dnd.ts @@ -8,5 +8,6 @@ export async function test(options: RunOptions) { branch: "main", build: "build", test: ["test"], + agent: "yarn@berry", }); } diff --git a/.github/swc-ecosystem-ci/utils.ts b/.github/swc-ecosystem-ci/utils.ts index c8d315059c2b..3cec1ccf72b4 100644 --- a/.github/swc-ecosystem-ci/utils.ts +++ b/.github/swc-ecosystem-ci/utils.ts @@ -59,7 +59,13 @@ export async function $(literals: TemplateStringsArray, ...values: any[]) { const root = dirnameFrom(import.meta.url); export async function setupEnvironment(): Promise { - const workspace = path.resolve(root, "workspace"); + const workspace = path.resolve( + root, + "..", + "..", + "..", + "swc-ecosystem-ci-workspace", + ); swcPath = path.resolve(workspace, ".swc"); cwd = process.cwd(); env = { @@ -224,9 +230,10 @@ export async function runInRepo(options: RunOptions & RepoOptions) { cd(dir); } if (options.agent == null) { - const detectedAgent = await detect({ cwd: dir, autoInstall: true }); + let detectedAgent = await detect({ cwd: dir, autoInstall: true }); if (detectedAgent == null) { - throw new Error(`Failed to detect packagemanager in ${dir}`); + console.error(`Failed to detect packagemanager in ${dir}`); + detectedAgent = "npm"; } options.agent = detectedAgent; } @@ -265,8 +272,7 @@ export async function runInRepo(options: RunOptions & RepoOptions) { } const overrides = options.overrides || {}; // https://github.com/facebook/react-native/issues/35701#issuecomment-1697798232 - overrides["jest"] = path.join(swcPath, "node_modules", "jest"); - overrides["ts-node"] = path.join(swcPath, "node_modules", "ts-node"); + overrides["@swc/jest"] = path.join(swcPath, "node_modules", "@swc", "jest"); overrides["@swc/core"] = path.join(swcPath, "node_modules", "@swc", "core"); overrides["@swc/types"] = path.join(swcPath, "node_modules", "@swc", "types"); console.log("OVERRIDES", overrides); @@ -496,7 +502,7 @@ export async function installSwc({ version }: { version: string }) { await fs.promises.mkdir(swcPath, { recursive: true }); await fs.promises.writeFile(path.join(swcPath, "package.json"), "{}", "utf8"); cd(swcPath); - await $`npm install @swc/core@${version} @swc/jest @swc/types ts-node@11.0.0-beta.1 jest@29.6.4 --no-save --force`; + await $`npm install @swc/core@${version} @swc/jest @swc/types --no-save --force`; } export const isWorkingWithIgnoredTess = process.env.CI_MODE === "ignored";