mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-21 18:32:52 +01:00
* Pin GitHub Actions to full-length commit SHAs * chore: attest to third-party action pinning changes I have reviewed the action-pinning diff authored by OssSecurityBot and verified that each pinned SHA resolves to the same commit the tag it replaces pointed at, and that no workflow logic was altered beyond the `uses:` references. This commit is signed with my key from security/trusted-signing-keys.csv so the attestation is bound to my identity and to this exact tree. Any subsequent push replaces the head and invalidates it. Refs #328868 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: OssSecurityBot <oss-security-bot@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
430 lines
13 KiB
YAML
430 lines
13 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: [ self-hosted, 1ES.Pool=1es-vscode-oss-ubuntu-22.04-x64, "JobId=compile-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" ]
|
|
steps:
|
|
- name: Checkout microsoft/vscode
|
|
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
|
|
with:
|
|
node-version-file: .nvmrc
|
|
|
|
- name: Restore node_modules cache
|
|
id: cache-node-modules
|
|
uses: ./.github/actions/restore-node-modules
|
|
with:
|
|
key-prefix: node_modules-compile
|
|
key-args: "compile $(node -p process.arch)"
|
|
|
|
- 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: Type check /build/ scripts
|
|
run: npm run typecheck
|
|
working-directory: build
|
|
|
|
- name: Prepare built-in extensions cache key
|
|
shell: pwsh
|
|
run: node build/azure-pipelines/common/computeBuiltInDepsCacheKey.ts > .build/builtindepshash
|
|
|
|
- name: Restore built-in extensions cache
|
|
id: cache-builtin-extensions
|
|
uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
|
|
with:
|
|
enableCrossOsArchive: true
|
|
path: .build/builtInExtensions
|
|
key: "builtin-extensions-${{ hashFiles('.build/builtindepshash') }}"
|
|
|
|
- name: Download built-in extensions
|
|
if: steps.cache-builtin-extensions.outputs.cache-hit != 'true'
|
|
run: node build/lib/builtInExtensions.ts
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- 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 Codex protocol client is in sync
|
|
run: |
|
|
git fetch --no-tags --depth=1 origin "$CODEX_SYNC_BASE" || true
|
|
node build/codex/check-protocol-sync.ts --if-changed --base "$CODEX_SYNC_BASE"
|
|
env:
|
|
CODEX_SYNC_BASE: ${{ github.event.pull_request.base.sha }}
|
|
|
|
- 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
|
|
smoke_tests: false
|
|
|
|
linux-electron-smoke-tests:
|
|
name: Linux
|
|
uses: ./.github/workflows/pr-linux-test.yml
|
|
with:
|
|
job_name: Electron-Smoke
|
|
electron_tests: true
|
|
unit_and_integration_tests: false
|
|
|
|
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
|
|
smoke_tests: false
|
|
|
|
macos-electron-smoke-tests:
|
|
name: macOS
|
|
uses: ./.github/workflows/pr-darwin-test.yml
|
|
with:
|
|
job_name: Electron-Smoke
|
|
electron_tests: true
|
|
unit_and_integration_tests: false
|
|
|
|
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
|
|
smoke_tests: false
|
|
|
|
windows-electron-smoke-tests:
|
|
name: Windows
|
|
uses: ./.github/workflows/pr-win32-test.yml
|
|
with:
|
|
job_name: Electron-Smoke
|
|
electron_tests: true
|
|
unit_and_integration_tests: false
|
|
|
|
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: [ self-hosted, 1ES.Pool=1es-vscode-oss-ubuntu-22.04-x64, "JobId=copilot-check-test-cache-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" ]
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
with:
|
|
lfs: true
|
|
|
|
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
|
|
with:
|
|
node-version-file: extensions/copilot/.nvmrc
|
|
|
|
- name: Restore node_modules cache
|
|
id: cache-node-modules
|
|
uses: ./.github/actions/restore-node-modules
|
|
with:
|
|
key-prefix: copilot-node_modules-linux
|
|
key-args: "$(node -p process.platform) $(node -p process.arch)"
|
|
|
|
- name: Install root dependencies
|
|
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
run: npm ci --ignore-scripts --no-workspaces
|
|
|
|
- name: Install copilot dependencies
|
|
if: steps.cache-node-modules.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: [ self-hosted, 1ES.Pool=1es-vscode-oss-ubuntu-22.04-x64, "JobId=copilot-check-telemetry-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" ]
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
with:
|
|
lfs: true
|
|
|
|
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
|
|
with:
|
|
node-version-file: extensions/copilot/.nvmrc
|
|
|
|
- name: Validate telemetry events
|
|
working-directory: extensions/copilot
|
|
run: npx --package=@vscode/telemetry-extractor@1.20.4 --yes vscode-telemetry-extractor -s . > /dev/null
|
|
|
|
copilot-linux-tests:
|
|
name: Copilot - Test (Linux)
|
|
runs-on: [ self-hosted, 1ES.Pool=1es-vscode-oss-ubuntu-22.04-x64, "JobId=copilot-linux-tests-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" ]
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
|
|
with:
|
|
node-version-file: extensions/copilot/.nvmrc
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
with:
|
|
python-version: '3.12'
|
|
architecture: 'x64'
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
|
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 node_modules cache
|
|
id: cache-node-modules
|
|
uses: ./.github/actions/restore-node-modules
|
|
with:
|
|
key-prefix: copilot-node_modules-linux
|
|
key-args: "$(node -p process.platform) $(node -p process.arch)"
|
|
|
|
- name: Install root dependencies
|
|
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
run: npm ci --ignore-scripts --no-workspaces
|
|
|
|
- name: Install copilot dependencies
|
|
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
working-directory: extensions/copilot
|
|
run: npm ci
|
|
|
|
- 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 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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
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: [ self-hosted, 1ES.Pool=1es-vscode-oss-windows-2022-x64, "JobId=copilot-windows-tests-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" ]
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
|
|
with:
|
|
node-version-file: extensions/copilot/.nvmrc
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
with:
|
|
python-version: '3.12'
|
|
architecture: 'x64'
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
|
|
with:
|
|
dotnet-version: '10.0'
|
|
|
|
- name: Install setuptools
|
|
run: pip install setuptools
|
|
|
|
- name: Restore node_modules cache
|
|
id: cache-node-modules
|
|
uses: ./.github/actions/restore-node-modules
|
|
with:
|
|
key-prefix: copilot-node_modules-windows
|
|
key-args: "$(node -p process.platform) $(node -p process.arch)"
|
|
|
|
- name: Install root dependencies
|
|
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
run: npm ci --ignore-scripts --no-workspaces
|
|
|
|
- name: Install copilot dependencies
|
|
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
working-directory: extensions/copilot
|
|
run: npm ci
|
|
|
|
- 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 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
|
|
|
|
|