From 957caeeb5922db99ba1acd9b90f30f69d7fbe347 Mon Sep 17 00:00:00 2001 From: Pokey Rule <755842+pokey@users.noreply.github.com> Date: Thu, 18 Apr 2024 20:16:43 +0100 Subject: [PATCH] Fix Windows CI by pinning node version (#2297) Windows CI started failing due to a node.js regression. We should really be pinning node, like we pin pnpm and all our pnpm dependencies. The only things we don't want to pin are OS version and vscode version This PR pins node and adds some debug output for the future ## Checklist - [x] Pin node using technique removed from #2217 - [x] Double-check pnpm pinning - [x] Keep some of the print statements here - [x] Remove code that slices args - [ ] Add checklist somewhere of versions to check when this kind of thing happens - [ ] node version (note this will be pinned) - [ ] OS version - [ ] vscode version - [-] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [-] I have not broken the cheatsheet --- .github/workflows/deploy.yaml | 2 +- .github/workflows/pre-commit.yml | 2 +- .github/workflows/test-docs.yml | 2 +- .github/workflows/test.yml | 2 +- .nvmrc | 1 + .../src/launchVscodeAndRunTests.ts | 34 +++++++++++-------- 6 files changed, 25 insertions(+), 18 deletions(-) create mode 100644 .nvmrc diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 6ac98093fb..c9ac7ea536 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -20,7 +20,7 @@ jobs: - run: corepack enable - uses: actions/setup-node@v4 with: - node-version-file: package.json + node-version-file: .nvmrc cache: pnpm - run: pnpm --color install - run: pnpm --color compile diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 6ce57b6e06..8ab2696c91 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -21,7 +21,7 @@ jobs: - run: corepack enable - uses: actions/setup-node@v4 with: - node-version-file: package.json + node-version-file: .nvmrc cache: pnpm - run: pnpm --color install - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/test-docs.yml b/.github/workflows/test-docs.yml index ae2ce4c03a..31a583abfc 100644 --- a/.github/workflows/test-docs.yml +++ b/.github/workflows/test-docs.yml @@ -16,6 +16,6 @@ jobs: - run: corepack enable - uses: actions/setup-node@v4 with: - node-version-file: package.json + node-version-file: .nvmrc cache: pnpm - run: bash -x scripts/build-and-assemble-website.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de58a90b91..df66cba4bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: - run: corepack enable - uses: actions/setup-node@v4 with: - node-version-file: package.json + node-version-file: .nvmrc cache: pnpm - run: mkdir -p "${{ env.VSCODE_CRASH_DIR }}" "${{ env.VSCODE_LOGS_DIR }}" shell: bash diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..020fc41da2 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v20.12.1 diff --git a/packages/test-harness/src/launchVscodeAndRunTests.ts b/packages/test-harness/src/launchVscodeAndRunTests.ts index be2c0958be..d20d7a69ac 100644 --- a/packages/test-harness/src/launchVscodeAndRunTests.ts +++ b/packages/test-harness/src/launchVscodeAndRunTests.ts @@ -41,20 +41,26 @@ export async function launchVscodeAndRunTests(extensionTestsPath: string) { resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath); // Install extension dependencies - cp.spawnSync( - cli, - [ - ...args, - ...extensionDependencies.flatMap((dependency) => [ - "--install-extension", - dependency, - ]), - ], - { - encoding: "utf-8", - stdio: "inherit", - }, - ); + const extensionInstallArgs = [ + ...args, + ...extensionDependencies.flatMap((dependency) => [ + "--install-extension", + dependency, + ]), + ]; + + console.log("starting to install dependency extensions"); + console.log(`cli: ${cli}`); + console.log(JSON.stringify(extensionInstallArgs, null, 2)); + + const { status, signal, error } = cp.spawnSync(cli, extensionInstallArgs, { + encoding: "utf-8", + stdio: "inherit", + }); + + console.log("status: ", status); + console.log("signal: ", signal); + console.log("error: ", error); console.log("finished installing dependency extensions");