mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-10 17:43:38 -05:00
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/cache dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
425 lines
12 KiB
YAML
425 lines
12 KiB
YAML
name: Code OSS
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- 'release/*'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
VSCODE_QUALITY: 'oss'
|
|
|
|
jobs:
|
|
compile:
|
|
name: Compile & Hygiene
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout microsoft/vscode
|
|
uses: actions/checkout@v6
|
|
with:
|
|
lfs: true
|
|
|
|
- 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.ts compile $(node -p process.arch) > .build/packagelockhash
|
|
|
|
- name: Restore node_modules cache
|
|
id: cache-node-modules
|
|
uses: actions/cache/restore@v5
|
|
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.ts .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: Type check /build/ scripts
|
|
run: npm run typecheck
|
|
working-directory: build
|
|
|
|
- name: Compile & Hygiene
|
|
run: npm exec -- npm-run-all2 -lp core-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 }}
|
|
|
|
- name: Check cyclic dependencies
|
|
run: node build/lib/checkCyclicDependencies.ts out-build
|
|
|
|
linux-cli-tests:
|
|
name: Linux
|
|
uses: ./.github/workflows/pr-linux-cli-test.yml
|
|
with:
|
|
job_name: CLI
|
|
rustup_toolchain: 1.88
|
|
|
|
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
|
|
|
|
copilot-check-test-cache:
|
|
name: Copilot - Check Test Cache
|
|
runs-on: ubuntu-22.04
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
lfs: true
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version-file: extensions/copilot/.nvmrc
|
|
|
|
- name: Restore build cache
|
|
uses: actions/cache/restore@v5
|
|
id: build-cache
|
|
with:
|
|
key: copilot-build_cache-${{ hashFiles('extensions/copilot/build/.cachesalt', 'extensions/copilot/package-lock.json') }}
|
|
path: extensions/copilot/.build/build_cache
|
|
|
|
- name: Extract build cache
|
|
if: steps.build-cache.outputs.cache-hit == 'true'
|
|
working-directory: extensions/copilot
|
|
run: tar -xzf .build/build_cache/cache.tgz
|
|
|
|
- name: Install dependencies
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
working-directory: extensions/copilot
|
|
run: npm ci
|
|
|
|
- name: Ensure no duplicate cache keys
|
|
working-directory: extensions/copilot
|
|
run: npx tsx test/base/cache-cli check
|
|
|
|
- name: Ensure no untrusted cache changes
|
|
if: github.event_name == 'pull_request'
|
|
working-directory: extensions/copilot
|
|
run: npx tsx build/pr-check-cache-files.ts
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
REPOSITORY: ${{ github.repository }}
|
|
PULL_REQUEST: ${{ github.event.pull_request.number }}
|
|
|
|
copilot-check-telemetry:
|
|
name: Copilot - Check Telemetry
|
|
runs-on: ubuntu-22.04
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
lfs: true
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '22.21.x'
|
|
|
|
- name: Validate telemetry events
|
|
working-directory: extensions/copilot
|
|
run: npx --package=@vscode/telemetry-extractor --yes vscode-telemetry-extractor -s . > /dev/null
|
|
|
|
copilot-linux-tests:
|
|
name: Copilot - Test (Linux)
|
|
runs-on: ubuntu-22.04
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '22.21.x'
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.12'
|
|
architecture: 'x64'
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v5
|
|
with:
|
|
dotnet-version: '10.0'
|
|
|
|
- name: Install setuptools
|
|
run: pip install setuptools
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y xvfb libgtk-3-0 libgbm1
|
|
|
|
- name: Restore build cache
|
|
uses: actions/cache/restore@v5
|
|
id: build-cache
|
|
with:
|
|
key: copilot-build_cache-${{ hashFiles('extensions/copilot/build/.cachesalt', 'extensions/copilot/package-lock.json') }}
|
|
path: extensions/copilot/.build/build_cache
|
|
|
|
- name: Extract build cache
|
|
if: steps.build-cache.outputs.cache-hit == 'true'
|
|
working-directory: extensions/copilot
|
|
run: tar -xzf .build/build_cache/cache.tgz
|
|
|
|
- name: Install dependencies
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
working-directory: extensions/copilot
|
|
run: npm ci
|
|
|
|
- name: Create build cache archive
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
working-directory: extensions/copilot
|
|
run: |
|
|
set -e
|
|
mkdir -p .build
|
|
node build/listBuildCacheFiles.js .build/build_cache_list.txt
|
|
mkdir -p .build/build_cache
|
|
tar -czf .build/build_cache/cache.tgz --files-from .build/build_cache_list.txt
|
|
|
|
- name: Ensure proposed API types are up to date
|
|
working-directory: extensions/copilot
|
|
run: npm run vscode-dts:check
|
|
|
|
- name: TypeScript type checking
|
|
working-directory: extensions/copilot
|
|
run: npm run typecheck
|
|
|
|
- name: Lint
|
|
working-directory: extensions/copilot
|
|
run: npm run lint
|
|
|
|
- name: Compile
|
|
working-directory: extensions/copilot
|
|
run: npm run compile
|
|
|
|
- name: Run vitest unit tests
|
|
working-directory: extensions/copilot
|
|
run: npm run test:unit
|
|
|
|
- name: Run simulation tests with cache
|
|
working-directory: extensions/copilot
|
|
run: npm run simulate-ci
|
|
|
|
- name: Run extension tests using VS Code
|
|
working-directory: extensions/copilot
|
|
run: xvfb-run -a npm run test:extension
|
|
|
|
- name: Run Completions Core prompt tests
|
|
working-directory: extensions/copilot
|
|
run: npm run test:prompt
|
|
|
|
- name: Run Completions Core lib tests using VS Code
|
|
working-directory: extensions/copilot
|
|
run: xvfb-run -a npm run test:completions-core
|
|
|
|
- name: Archive simulation output
|
|
if: always()
|
|
working-directory: extensions/copilot
|
|
run: |
|
|
set -e
|
|
mkdir -p .simulation-archive
|
|
tar -czf .simulation-archive/simulation.tgz -C .simulation .
|
|
|
|
- name: Upload simulation output
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: copilot-simulation-output-linux-${{ github.run_attempt }}
|
|
path: extensions/copilot/.simulation-archive/simulation.tgz
|
|
|
|
copilot-windows-tests:
|
|
name: Copilot - Test (Windows)
|
|
runs-on: windows-2022
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '22.21.x'
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.12'
|
|
architecture: 'x64'
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v5
|
|
with:
|
|
dotnet-version: '10.0'
|
|
|
|
- name: Install setuptools
|
|
run: pip install setuptools
|
|
|
|
- name: Restore build cache
|
|
uses: actions/cache/restore@v5
|
|
id: build-cache
|
|
with:
|
|
key: copilot-windows-build_cache-${{ hashFiles('extensions/copilot/build/.cachesalt', 'extensions/copilot/package-lock.json') }}
|
|
path: extensions/copilot/.build/build_cache
|
|
|
|
- name: Extract build cache
|
|
if: steps.build-cache.outputs.cache-hit == 'true'
|
|
working-directory: extensions/copilot
|
|
run: 7z.exe x .build/build_cache/cache.7z -aoa
|
|
|
|
- name: Install dependencies
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
working-directory: extensions/copilot
|
|
run: npm ci
|
|
|
|
- name: Create build cache archive
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
working-directory: extensions/copilot
|
|
run: |
|
|
mkdir -Force .build
|
|
node build/listBuildCacheFiles.js .build/build_cache_list.txt
|
|
mkdir -Force .build/build_cache
|
|
7z.exe a .build/build_cache/cache.7z -mx3 `@.build/build_cache_list.txt
|
|
|
|
- name: TypeScript type checking
|
|
working-directory: extensions/copilot
|
|
run: npm run typecheck
|
|
|
|
- name: Lint
|
|
working-directory: extensions/copilot
|
|
run: npm run lint
|
|
|
|
- name: Compile
|
|
working-directory: extensions/copilot
|
|
run: npm run compile
|
|
|
|
- name: Run vitest unit tests
|
|
working-directory: extensions/copilot
|
|
run: npm run test:unit
|
|
|
|
- name: Run simulation tests with cache
|
|
working-directory: extensions/copilot
|
|
run: npm run simulate-ci
|
|
|
|
- name: Run extension tests using VS Code
|
|
working-directory: extensions/copilot
|
|
run: npm run test:extension
|
|
|
|
- name: Run Completions Core prompt tests
|
|
working-directory: extensions/copilot
|
|
run: npm run test:prompt
|
|
|
|
- name: Run Completions Core lib tests using VS Code
|
|
working-directory: extensions/copilot
|
|
run: npm run test:completions-core
|