fix: improve E2E test configuration and packaging documentation #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Code OSS | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - 'release/*' | ||
| paths-ignore: | ||
| - '**.md' | ||
| - 'docs/**' | ||
| - '.github/CODEOWNERS' | ||
| - '.github/ISSUE_TEMPLATE/**' | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| permissions: {} | ||
| env: | ||
| VSCODE_QUALITY: 'oss' | ||
| jobs: | ||
| # ============================================================================ | ||
| # REQUIRED CHECKS - These must pass for PR to be mergeable | ||
| # ============================================================================ | ||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| - name: Restore node_modules cache | ||
| id: cache-node-modules | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node_modules-lint-${{ hashFiles('package-lock.json') }} | ||
| restore-keys: | | ||
| node_modules-lint- | ||
| - name: Install dependencies | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: npm ci | ||
| env: | ||
| ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | ||
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Run ESLint | ||
| run: npm run eslint | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Cache node_modules | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node_modules-lint-${{ hashFiles('package-lock.json') }} | ||
| typecheck: | ||
| name: Typecheck | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| - name: Restore node_modules cache | ||
| id: cache-node-modules | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node_modules-typecheck-${{ hashFiles('package-lock.json') }} | ||
| restore-keys: | | ||
| node_modules-typecheck- | ||
| - name: Install dependencies | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: npm ci | ||
| env: | ||
| ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | ||
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Compile build folder | ||
| working-directory: build | ||
| run: npm run compile || (npm ci && npm run compile) | ||
| - name: TypeScript Compile Check | ||
| run: npm run compile-check-ts-native | ||
| - name: Valid Layers Check | ||
| run: npm run valid-layers-check | ||
| - name: VSCode DTS Compile Check | ||
| run: npm run vscode-dts-compile-check | ||
| - name: TSEC Compile Check | ||
| run: npm run tsec-compile-check | ||
| - name: Cache node_modules | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node_modules-typecheck-${{ hashFiles('package-lock.json') }} | ||
| test-unit: | ||
| name: Unit Tests | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| - name: Restore node_modules cache | ||
| id: cache-node-modules | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node_modules-test-${{ hashFiles('package-lock.json') }} | ||
| restore-keys: | | ||
| node_modules-test- | ||
| - name: Install dependencies | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: npm ci | ||
| env: | ||
| ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | ||
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Run unit tests (Node.js) | ||
| run: npm run test-node | ||
| - name: Cache node_modules | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node_modules-test-${{ hashFiles('package-lock.json') }} | ||
| build-compile: | ||
| name: Build Compile | ||
| runs-on: [ self-hosted, 1ES.Pool=1es-vscode-oss-ubuntu-22.04-x64 ] | ||
| steps: | ||
| - name: Checkout microsoft/vscode | ||
| uses: actions/checkout@v5 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| - name: Prepare node_modules cache key | ||
| run: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js compile $(node -p process.arch) > .build/packagelockhash | ||
| - name: Restore node_modules cache | ||
| id: cache-node-modules | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: .build/node_modules_cache | ||
| key: "node_modules-compile-${{ hashFiles('.build/packagelockhash') }}" | ||
| - name: Extract node_modules cache | ||
| if: steps.cache-node-modules.outputs.cache-hit == 'true' | ||
| run: tar -xzf .build/node_modules_cache/cache.tgz | ||
| - name: Install build tools | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: sudo apt update -y && sudo apt install -y build-essential pkg-config libx11-dev libx11-xcb-dev libxkbfile-dev libnotify-bin libkrb5-dev | ||
| - name: Install dependencies | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: | | ||
| set -e | ||
| for i in {1..5}; do # try 5 times | ||
| npm ci && break | ||
| if [ $i -eq 5 ]; then | ||
| echo "Npm install failed too many times" >&2 | ||
| exit 1 | ||
| fi | ||
| echo "Npm install failed $i, trying again..." | ||
| done | ||
| env: | ||
| ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | ||
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Create node_modules archive | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: | | ||
| set -e | ||
| node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt | ||
| mkdir -p .build/node_modules_cache | ||
| tar -czf .build/node_modules_cache/cache.tgz --files-from .build/node_modules_list.txt | ||
| - name: Compile /build/ folder | ||
| run: npm run compile | ||
| working-directory: build | ||
| - name: Check /build/ folder | ||
| run: .github/workflows/check-clean-git-state.sh | ||
| - name: Compile & Hygiene | ||
| run: npm exec -- npm-run-all -lp core-ci extensions-ci hygiene eslint valid-layers-check define-class-fields-check vscode-dts-compile-check tsec-compile-check test-build-scripts | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| smoke-headless: | ||
| name: Smoke Headless | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| - name: Restore node_modules cache | ||
| id: cache-node-modules | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node_modules-smoke-${{ hashFiles('package-lock.json') }} | ||
| restore-keys: | | ||
| node_modules-smoke- | ||
| - name: Install dependencies | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: npm ci | ||
| env: | ||
| ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | ||
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Transpile client and extensions | ||
| run: npm run gulp transpile-client-esbuild transpile-extensions | ||
| - name: Download Electron | ||
| run: npm run electron | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Compile smoke tests | ||
| working-directory: test/smoke | ||
| run: npm run compile | ||
| - name: Compile extensions for smoke tests | ||
| run: npm run gulp compile-extension-media | ||
| - name: Run headless smoke test | ||
| run: npm run smoketest-no-compile -- --headless --quick || npm run smoketest-no-compile -- --web --headless --quick | ||
| continue-on-error: false | ||
| - name: Cache node_modules | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node_modules-smoke-${{ hashFiles('package-lock.json') }} | ||
| e2e-sanity: | ||
| name: E2E Sanity | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v5 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| - name: Restore node_modules cache | ||
| id: cache-node-modules | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node_modules-e2e-${{ hashFiles('package-lock.json') }} | ||
| restore-keys: | | ||
| node_modules-e2e- | ||
| - name: Install dependencies | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: npm ci | ||
| env: | ||
| ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | ||
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
| - name: Cache Playwright browsers | ||
| id: cache-playwright | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/ms-playwright | ||
| key: playwright-browsers-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | ||
| restore-keys: | | ||
| playwright-browsers-${{ runner.os }}- | ||
| - name: Install Playwright browsers | ||
| if: steps.cache-playwright.outputs.cache-hit != 'true' | ||
| run: npx playwright install --with-deps chromium | ||
| env: | ||
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 0 | ||
| - name: Transpile client and extensions | ||
| run: npm run gulp transpile-client-esbuild transpile-extensions | ||
| - name: Run E2E tests | ||
| working-directory: test/e2e | ||
| run: npx playwright test | ||
| continue-on-error: true | ||
| env: | ||
| CI: true | ||
| - name: Check E2E test results | ||
| if: failure() | ||
| run: | | ||
| echo "::warning::E2E tests failed. This is non-blocking but should be investigated." | ||
| echo "Test results are available in the uploaded artifacts." | ||
| exit 0 | ||
| - name: Upload test results | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: playwright-report-${{ github.run_id }} | ||
| path: test/e2e/playwright-report/ | ||
| retention-days: 7 | ||
| if-no-files-found: ignore | ||
| - name: Cache node_modules | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: node_modules | ||
| key: node_modules-e2e-${{ hashFiles('package-lock.json') }} | ||
| # ============================================================================ | ||
| # EXISTING COMPREHENSIVE TESTS (kept for thoroughness) | ||
| # ============================================================================ | ||
| compile: | ||
| name: Compile & Hygiene | ||
| runs-on: [ self-hosted, 1ES.Pool=1es-vscode-oss-ubuntu-22.04-x64 ] | ||
| steps: | ||
| - name: Checkout microsoft/vscode | ||
| uses: actions/checkout@v5 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| - name: Prepare node_modules cache key | ||
| run: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js compile $(node -p process.arch) > .build/packagelockhash | ||
| - name: Restore node_modules cache | ||
| id: cache-node-modules | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: .build/node_modules_cache | ||
| key: "node_modules-compile-${{ hashFiles('.build/packagelockhash') }}" | ||
| - name: Extract node_modules cache | ||
| if: steps.cache-node-modules.outputs.cache-hit == 'true' | ||
| run: tar -xzf .build/node_modules_cache/cache.tgz | ||
| - name: Install build tools | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: sudo apt update -y && sudo apt install -y build-essential pkg-config libx11-dev libx11-xcb-dev libxkbfile-dev libnotify-bin libkrb5-dev | ||
| - name: Install dependencies | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: | | ||
| set -e | ||
| for i in {1..5}; do # try 5 times | ||
| npm ci && break | ||
| if [ $i -eq 5 ]; then | ||
| echo "Npm install failed too many times" >&2 | ||
| exit 1 | ||
| fi | ||
| echo "Npm install failed $i, trying again..." | ||
| done | ||
| env: | ||
| ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | ||
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Create node_modules archive | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| run: | | ||
| set -e | ||
| node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt | ||
| mkdir -p .build/node_modules_cache | ||
| tar -czf .build/node_modules_cache/cache.tgz --files-from .build/node_modules_list.txt | ||
| - name: Compile /build/ folder | ||
| run: npm run compile | ||
| working-directory: build | ||
| - name: Check /build/ folder | ||
| run: .github/workflows/check-clean-git-state.sh | ||
| - name: Compile & Hygiene | ||
| run: npm exec -- npm-run-all -lp core-ci extensions-ci hygiene eslint valid-layers-check define-class-fields-check vscode-dts-compile-check tsec-compile-check test-build-scripts | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| linux-cli-tests: | ||
| name: Linux | ||
| uses: ./.github/workflows/pr-linux-cli-test.yml | ||
| with: | ||
| job_name: CLI | ||
| rustup_toolchain: 1.85 | ||
| linux-electron-tests: | ||
| name: Linux | ||
| uses: ./.github/workflows/pr-linux-test.yml | ||
| with: | ||
| job_name: Electron | ||
| electron_tests: true | ||
| linux-browser-tests: | ||
| name: Linux | ||
| uses: ./.github/workflows/pr-linux-test.yml | ||
| with: | ||
| job_name: Browser | ||
| browser_tests: true | ||
| linux-remote-tests: | ||
| name: Linux | ||
| uses: ./.github/workflows/pr-linux-test.yml | ||
| with: | ||
| job_name: Remote | ||
| remote_tests: true | ||
| macos-electron-tests: | ||
| name: macOS | ||
| uses: ./.github/workflows/pr-darwin-test.yml | ||
| with: | ||
| job_name: Electron | ||
| electron_tests: true | ||
| macos-browser-tests: | ||
| name: macOS | ||
| uses: ./.github/workflows/pr-darwin-test.yml | ||
| with: | ||
| job_name: Browser | ||
| browser_tests: true | ||
| macos-remote-tests: | ||
| name: macOS | ||
| uses: ./.github/workflows/pr-darwin-test.yml | ||
| with: | ||
| job_name: Remote | ||
| remote_tests: true | ||
| windows-electron-tests: | ||
| name: Windows | ||
| uses: ./.github/workflows/pr-win32-test.yml | ||
| with: | ||
| job_name: Electron | ||
| electron_tests: true | ||
| windows-browser-tests: | ||
| name: Windows | ||
| uses: ./.github/workflows/pr-win32-test.yml | ||
| with: | ||
| job_name: Browser | ||
| browser_tests: true | ||
| windows-remote-tests: | ||
| name: Windows | ||
| uses: ./.github/workflows/pr-win32-test.yml | ||
| with: | ||
| job_name: Remote | ||
| remote_tests: true | ||