From 037b36eecc4c442455022a8ec1e0d7636a42f5b0 Mon Sep 17 00:00:00 2001 From: Alex Ross <38270282+alexr00@users.noreply.github.com> Date: Wed, 25 Nov 2026 12:41:47 +0100 Subject: [PATCH 1/5] Use GitHub Actions for PR checks --- .github/workflows/pr.yml | 72 +++++++++++++++++++++++++++++++++++++ README.md | 2 +- azure-pipeline.pr.yml | 51 -------------------------- scripts/ci/common-setup.yml | 12 ------- 4 files changed, 73 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/pr.yml delete mode 100644 azure-pipeline.pr.yml delete mode 100644 scripts/ci/common-setup.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000000..5280b5733d --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,72 @@ +name: PR Checks + +on: + push: + branches: + - main + - release/** + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + test_suite: + name: Test suite + runs-on: macos-15 + timeout-minutes: 60 + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + # The package quarantine check compares package-lock.json against HEAD^1. + fetch-depth: 2 + persist-credentials: false + + - name: Set up Node.js + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version: "24.x" + + - name: Enforce package quarantine + run: npm run check:package-quarantine + + - name: Install dependencies + shell: bash + run: | + for attempt in 1 2 3 4; do + npm ci && exit 0 + echo "npm ci failed (attempt $attempt)" + sleep $((attempt * 10)) + done + exit 1 + + - name: Compile + run: npm run compile + + - name: Run hygiene checks + run: npm run hygiene + + - name: Run lint + run: npm run lint + + - name: Verify command registrations + run: npm run check:commands + + - name: Run test suite + run: npm run test + env: + TEST_JUNIT_XML_PATH: ${{ runner.temp }}/test-results.xml + + - name: Upload test results + if: ${{ !cancelled() }} + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: test-results + path: ${{ runner.temp }}/*test-results.xml + if-no-files-found: ignore diff --git a/README.md b/README.md index ab59434c66..65dca6d819 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://dev.azure.com/vscode/vscode-pull-request-github/_apis/build/status/vscode-pull-request-github%20%28pr%29?branchName=main)](https://dev.azure.com/vscode/vscode-pull-request-github/_build?definitionId=44&branchName=main) +[![PR Checks](https://github.com/microsoft/vscode-pull-request-github/actions/workflows/pr.yml/badge.svg?branch=main)](https://github.com/microsoft/vscode-pull-request-github/actions/workflows/pr.yml?query=branch%3Amain) > Review and manage your GitHub pull requests and issues directly in VS Code diff --git a/azure-pipeline.pr.yml b/azure-pipeline.pr.yml deleted file mode 100644 index 4eab95d713..0000000000 --- a/azure-pipeline.pr.yml +++ /dev/null @@ -1,51 +0,0 @@ -jobs: - - job: test_suite - displayName: Test suite - pool: - vmImage: 'macos-15' - steps: - - checkout: self - fetchDepth: 2 - - - template: scripts/ci/common-setup.yml - - - script: npm run compile - displayName: Compile - - - script: npm run hygiene - displayName: Run hygiene checks - - - script: npm run lint - displayName: Run lint - - - script: npm run check:commands - displayName: Verify command registrations - - - script: npm run test - displayName: Run test suite - env: - TEST_JUNIT_XML_PATH: $(Agent.HomeDirectory)/test-results.xml - - # - script: npm run browsertest --browserType=chromium - # displayName: Run test suite (chromium) - # env: - # TEST_JUNIT_XML_PATH: $(Agent.HomeDirectory)/browser-chromium-test-results.xml - - # - script: npm run browsertest --browserType=firefox - # displayName: Run test suite (firefox) - # env: - # TEST_JUNIT_XML_PATH: $(Agent.HomeDirectory)/browser-firefox-test-results.xml - - # - script: npm run browsertest --browserType=webkit - # displayName: Run test suite (webkit) - # env: - # TEST_JUNIT_XML_PATH: $(Agent.HomeDirectory)/browser-webkit-test-results.xml - - - task: PublishTestResults@2 - displayName: Publish test results - inputs: - testResultsFormat: JUnit - testResultsFiles: $(Agent.HomeDirectory)/*test-results.xml - testRunTitle: Mocha test suite - failTaskOnFailedTests: true - condition: succeededOrFailed() diff --git a/scripts/ci/common-setup.yml b/scripts/ci/common-setup.yml deleted file mode 100644 index 21ce30ecde..0000000000 --- a/scripts/ci/common-setup.yml +++ /dev/null @@ -1,12 +0,0 @@ -steps: - - task: UseNode@1 - displayName: Upgrade Node - inputs: - version: "24.x" - - - script: npm run check:package-quarantine - displayName: Enforce package quarantine - - - script: npm ci - displayName: Install dependencies - retryCountOnTaskFailure: 3 From 58b24b31b78c3f6c2d8a02158b450a3aabdc7170 Mon Sep 17 00:00:00 2001 From: Alex Ross <38270282+alexr00@users.noreply.github.com> Date: Wed, 25 Nov 2026 15:18:34 +0100 Subject: [PATCH 2/5] Try fix checks --- src/test/runTests.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/test/runTests.ts b/src/test/runTests.ts index 9231d47d6f..e0fd3c1a68 100644 --- a/src/test/runTests.ts +++ b/src/test/runTests.ts @@ -3,7 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { existsSync } from 'fs'; +import { existsSync, mkdtempSync, rmSync } from 'fs'; +import * as os from 'os'; import * as path from 'path'; import { downloadAndUnzipVSCode, runTests } from '@vscode/test-electron'; @@ -23,6 +24,9 @@ async function downloadVSCodeInsiders(): Promise { } async function go() { + // VS Code creates its IPC socket in the user data dir, and Unix socket paths are limited to ~103 chars on macOS. + // The default (.vscode-test/user-data in the repo) is too long for deep checkouts, so use a short temp dir. + const userDataDir = mkdtempSync(path.join(os.tmpdir(), 'vscode-test-')); try { const extensionDevelopmentPath = path.resolve(__dirname, '../../../'); const extensionTestsPath = path.resolve(__dirname, './'); @@ -36,11 +40,13 @@ async function go() { vscodeExecutablePath, extensionDevelopmentPath, extensionTestsPath, - launchArgs: ['--disable-extensions'], + launchArgs: ['--disable-extensions', `--user-data-dir=${userDataDir}`], }); } catch (e) { console.log(e); - process.exit(1); + process.exitCode = 1; + } finally { + rmSync(userDataDir, { recursive: true, force: true }); } } From c74dd3dbc8e7ceec1ae43373f0175a8a2f5db554 Mon Sep 17 00:00:00 2001 From: Alex Ross <38270282+alexr00@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:24:27 +0100 Subject: [PATCH 3/5] Restore deleted files --- azure-pipeline.pr.yml | 51 +++++++++++++++++++++++++++++++++++++ scripts/ci/common-setup.yml | 12 +++++++++ 2 files changed, 63 insertions(+) create mode 100644 azure-pipeline.pr.yml create mode 100644 scripts/ci/common-setup.yml diff --git a/azure-pipeline.pr.yml b/azure-pipeline.pr.yml new file mode 100644 index 0000000000..4eab95d713 --- /dev/null +++ b/azure-pipeline.pr.yml @@ -0,0 +1,51 @@ +jobs: + - job: test_suite + displayName: Test suite + pool: + vmImage: 'macos-15' + steps: + - checkout: self + fetchDepth: 2 + + - template: scripts/ci/common-setup.yml + + - script: npm run compile + displayName: Compile + + - script: npm run hygiene + displayName: Run hygiene checks + + - script: npm run lint + displayName: Run lint + + - script: npm run check:commands + displayName: Verify command registrations + + - script: npm run test + displayName: Run test suite + env: + TEST_JUNIT_XML_PATH: $(Agent.HomeDirectory)/test-results.xml + + # - script: npm run browsertest --browserType=chromium + # displayName: Run test suite (chromium) + # env: + # TEST_JUNIT_XML_PATH: $(Agent.HomeDirectory)/browser-chromium-test-results.xml + + # - script: npm run browsertest --browserType=firefox + # displayName: Run test suite (firefox) + # env: + # TEST_JUNIT_XML_PATH: $(Agent.HomeDirectory)/browser-firefox-test-results.xml + + # - script: npm run browsertest --browserType=webkit + # displayName: Run test suite (webkit) + # env: + # TEST_JUNIT_XML_PATH: $(Agent.HomeDirectory)/browser-webkit-test-results.xml + + - task: PublishTestResults@2 + displayName: Publish test results + inputs: + testResultsFormat: JUnit + testResultsFiles: $(Agent.HomeDirectory)/*test-results.xml + testRunTitle: Mocha test suite + failTaskOnFailedTests: true + condition: succeededOrFailed() diff --git a/scripts/ci/common-setup.yml b/scripts/ci/common-setup.yml new file mode 100644 index 0000000000..21ce30ecde --- /dev/null +++ b/scripts/ci/common-setup.yml @@ -0,0 +1,12 @@ +steps: + - task: UseNode@1 + displayName: Upgrade Node + inputs: + version: "24.x" + + - script: npm run check:package-quarantine + displayName: Enforce package quarantine + + - script: npm ci + displayName: Install dependencies + retryCountOnTaskFailure: 3 From 549be593088ffcc67d7432777171dedc0495e71b Mon Sep 17 00:00:00 2001 From: Alex Ross <38270282+alexr00@users.noreply.github.com> Date: Wed, 25 Nov 2026 16:50:59 +0100 Subject: [PATCH 4/5] Fix windows tests --- src/test/runTests.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/test/runTests.ts b/src/test/runTests.ts index e0fd3c1a68..28550c2a8b 100644 --- a/src/test/runTests.ts +++ b/src/test/runTests.ts @@ -24,9 +24,13 @@ async function downloadVSCodeInsiders(): Promise { } async function go() { - // VS Code creates its IPC socket in the user data dir, and Unix socket paths are limited to ~103 chars on macOS. + // On macOS, VS Code creates its IPC socket in the user data dir, and Unix socket paths are limited to ~103 chars. // The default (.vscode-test/user-data in the repo) is too long for deep checkouts, so use a short temp dir. - const userDataDir = mkdtempSync(path.join(os.tmpdir(), 'vscode-test-')); + const userDataDir = process.platform === 'darwin' ? mkdtempSync(path.join(os.tmpdir(), 'vscode-test-')) : undefined; + const launchArgs = ['--disable-extensions']; + if (userDataDir) { + launchArgs.push(`--user-data-dir=${userDataDir}`); + } try { const extensionDevelopmentPath = path.resolve(__dirname, '../../../'); const extensionTestsPath = path.resolve(__dirname, './'); @@ -40,13 +44,15 @@ async function go() { vscodeExecutablePath, extensionDevelopmentPath, extensionTestsPath, - launchArgs: ['--disable-extensions', `--user-data-dir=${userDataDir}`], + launchArgs, }); } catch (e) { console.log(e); process.exitCode = 1; } finally { - rmSync(userDataDir, { recursive: true, force: true }); + if (userDataDir) { + rmSync(userDataDir, { recursive: true, force: true }); + } } } From ec799fdbe57c7f500ed3ca63ff62a6bd9385847c Mon Sep 17 00:00:00 2001 From: Alex Ross <38270282+alexr00@users.noreply.github.com> Date: Wed, 25 Nov 2026 17:53:16 +0100 Subject: [PATCH 5/5] Trigger PR sync