mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-16 05:11:14 +01:00
236 lines
6.2 KiB
YAML
236 lines
6.2 KiB
YAML
name: PR Checks
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'gh-readonly-queue/main/*'
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- 'release/*'
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
|
|
jobs:
|
|
check-test-cache:
|
|
name: Check test cache
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
lfs: true
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version-file: .nvmrc
|
|
|
|
- name: Restore build cache
|
|
uses: actions/cache/restore@v5
|
|
id: build-cache
|
|
with:
|
|
key: build_cache-${{ hashFiles('build/.cachesalt', 'package-lock.json') }}
|
|
path: .build/build_cache
|
|
|
|
- name: Extract build cache
|
|
if: steps.build-cache.outputs.cache-hit == 'true'
|
|
run: tar -xzf .build/build_cache/cache.tgz
|
|
|
|
- name: Install dependencies
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
run: npm ci
|
|
|
|
- name: Ensure no duplicate cache keys
|
|
run: npx tsx test/base/cache-cli check
|
|
|
|
- name: Ensure no untrusted cache changes
|
|
run: npx tsx build/pr-check-cache-files.ts
|
|
if: github.event_name == 'pull_request'
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
REPOSITORY: ${{ github.repository }}
|
|
PULL_REQUEST: ${{ github.event.pull_request.number }}
|
|
|
|
check-telemetry:
|
|
name: Check telemetry events
|
|
runs-on: ubuntu-22.04
|
|
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
|
|
run: npx --package=@vscode/telemetry-extractor --yes vscode-telemetry-extractor -s . > /dev/null
|
|
|
|
linux-tests:
|
|
name: Test (Linux)
|
|
runs-on: ubuntu-22.04
|
|
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: build_cache-${{ hashFiles('build/.cachesalt', 'package-lock.json') }}
|
|
path: .build/build_cache
|
|
|
|
- name: Extract build cache
|
|
if: steps.build-cache.outputs.cache-hit == 'true'
|
|
run: tar -xzf .build/build_cache/cache.tgz
|
|
|
|
- name: Install dependencies
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
run: npm ci
|
|
|
|
- name: Create build cache archive
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
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: TypeScript type checking
|
|
run: npm run typecheck
|
|
|
|
- name: Lint
|
|
run: npm run lint
|
|
|
|
- name: Compile
|
|
run: npm run compile
|
|
|
|
- name: Run vitest unit tests
|
|
run: npm run test:unit
|
|
|
|
- name: Run simulation tests with cache
|
|
run: npm run simulate-ci
|
|
|
|
- name: Run extension tests using VS Code
|
|
run: xvfb-run -a npm run test:extension
|
|
|
|
- name: Run Completions Core prompt tests
|
|
run: npm run test:prompt
|
|
|
|
- name: Run Completions Core lib tests using VS Code
|
|
run: xvfb-run -a npm run test:completions-core
|
|
|
|
- name: Archive simulation output
|
|
if: always()
|
|
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: simulation-output-linux-${{ github.run_attempt }}
|
|
path: .simulation-archive/simulation.tgz
|
|
|
|
windows-tests:
|
|
name: Test (Windows)
|
|
runs-on: windows-2022
|
|
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: windows-build_cache-${{ hashFiles('build/.cachesalt', 'package-lock.json') }}
|
|
path: .build/build_cache
|
|
|
|
- name: Extract build cache
|
|
if: steps.build-cache.outputs.cache-hit == 'true'
|
|
run: 7z.exe x .build/build_cache/cache.7z -aoa
|
|
|
|
- name: Install dependencies
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
run: npm ci
|
|
|
|
- name: Create build cache archive
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
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
|
|
run: npm run typecheck
|
|
|
|
- name: Lint
|
|
run: npm run lint
|
|
|
|
- name: Compile
|
|
run: npm run compile
|
|
|
|
- name: Run vitest unit tests
|
|
run: npm run test:unit
|
|
|
|
- name: Run simulation tests with cache
|
|
run: npm run simulate-ci
|
|
|
|
- name: Run extension tests using VS Code
|
|
run: npm run test:extension
|
|
|
|
- name: Run Completions Core prompt tests
|
|
run: npm run test:prompt
|
|
|
|
- name: Run Completions Core lib tests using VS Code
|
|
run: npm run test:completions-core
|