2022-05-11 10:08:54 +00:00
|
|
|
parameters:
|
|
|
|
- name: VSCODE_QUALITY
|
|
|
|
type: string
|
|
|
|
|
2019-07-03 13:31:02 +00:00
|
|
|
steps:
|
2020-11-24 10:44:18 +00:00
|
|
|
- task: NodeTool@0
|
|
|
|
inputs:
|
2023-10-05 02:08:50 +00:00
|
|
|
versionSource: fromFile
|
|
|
|
versionFilePath: .nvmrc
|
2023-10-20 07:53:57 +00:00
|
|
|
nodejsMirror: https://github.com/joaomoreno/node-mirror/releases/download
|
2020-11-24 10:44:18 +00:00
|
|
|
|
2023-04-02 07:35:39 +00:00
|
|
|
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
|
2024-03-21 13:16:32 +00:00
|
|
|
- template: ./distro/download-distro.yml@self
|
2023-04-02 07:35:39 +00:00
|
|
|
|
|
|
|
- task: AzureKeyVault@1
|
|
|
|
displayName: "Azure Key Vault: Get Secrets"
|
|
|
|
inputs:
|
|
|
|
azureSubscription: "vscode-builds-subscription"
|
|
|
|
KeyVaultName: vscode-build-secrets
|
|
|
|
SecretsFilter: "github-distro-mixin-password"
|
2020-11-24 10:44:18 +00:00
|
|
|
|
2022-10-27 10:31:15 +00:00
|
|
|
- script: node build/setup-npm-registry.js $NPM_REGISTRY
|
|
|
|
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))
|
|
|
|
displayName: Setup NPM Registry
|
|
|
|
|
2023-04-02 07:35:39 +00:00
|
|
|
- script: mkdir -p .build && node build/azure-pipelines/common/computeNodeModulesCacheKey.js compile > .build/yarnlockhash
|
|
|
|
displayName: Prepare node_modules cache key
|
2021-11-19 14:07:35 +00:00
|
|
|
|
2021-11-24 12:04:43 +00:00
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
2023-04-02 07:35:39 +00:00
|
|
|
key: '"node_modules" | .build/yarnlockhash'
|
2021-11-24 12:04:43 +00:00
|
|
|
path: .build/node_modules_cache
|
|
|
|
cacheHitVar: NODE_MODULES_RESTORED
|
|
|
|
displayName: Restore node_modules cache
|
2021-11-19 14:07:35 +00:00
|
|
|
|
2023-04-25 06:26:56 +00:00
|
|
|
- script: tar -xzf .build/node_modules_cache/cache.tgz
|
2021-11-24 12:04:43 +00:00
|
|
|
condition: and(succeeded(), eq(variables.NODE_MODULES_RESTORED, 'true'))
|
|
|
|
displayName: Extract node_modules cache
|
2020-11-24 10:44:18 +00:00
|
|
|
|
2021-01-07 09:53:33 +00:00
|
|
|
- script: |
|
2021-02-15 11:04:31 +00:00
|
|
|
set -e
|
2022-10-24 07:24:44 +00:00
|
|
|
npm config set registry "$NPM_REGISTRY" --location=project
|
2023-08-07 12:46:27 +00:00
|
|
|
# npm >v7 deprecated the `always-auth` config option, refs npm/cli@72a7eeb
|
|
|
|
# following is a workaround for yarn to send authorization header
|
|
|
|
# for GET requests to the registry.
|
|
|
|
echo "always-auth=true" >> .npmrc
|
2022-10-24 07:24:44 +00:00
|
|
|
yarn config set registry "$NPM_REGISTRY"
|
|
|
|
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'))
|
|
|
|
displayName: Setup NPM & Yarn
|
|
|
|
|
|
|
|
- task: npmAuthenticate@0
|
|
|
|
inputs:
|
|
|
|
workingFile: .npmrc
|
|
|
|
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'), ne(variables['NPM_REGISTRY'], 'none'))
|
|
|
|
displayName: Setup NPM Authentication
|
|
|
|
|
2023-09-06 12:24:39 +00:00
|
|
|
- script: sudo apt update -y && sudo apt install -y build-essential pkg-config libx11-dev libx11-xcb-dev libxkbfile-dev libnotify-bin libkrb5-dev
|
2021-01-05 11:01:07 +00:00
|
|
|
displayName: Install build tools
|
|
|
|
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
|
|
|
|
|
2020-11-24 10:44:18 +00:00
|
|
|
- script: |
|
|
|
|
set -e
|
2023-10-05 02:08:50 +00:00
|
|
|
npm i -g node-gyp@9.4.0
|
|
|
|
|
2023-01-17 12:48:02 +00:00
|
|
|
for i in {1..5}; do # try 5 times
|
2022-03-18 12:54:01 +00:00
|
|
|
yarn --frozen-lockfile --check-files && break
|
2020-12-12 13:23:11 +00:00
|
|
|
if [ $i -eq 3 ]; then
|
|
|
|
echo "Yarn failed too many times" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "Yarn failed $i, trying again..."
|
|
|
|
done
|
2020-12-15 14:58:47 +00:00
|
|
|
env:
|
|
|
|
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
|
2020-12-15 15:07:52 +00:00
|
|
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
2021-06-15 14:14:57 +00:00
|
|
|
GITHUB_TOKEN: "$(github-distro-mixin-password)"
|
2020-12-12 13:23:11 +00:00
|
|
|
displayName: Install dependencies
|
2020-12-24 09:08:06 +00:00
|
|
|
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
|
2020-12-12 13:23:11 +00:00
|
|
|
|
2023-04-02 07:35:39 +00:00
|
|
|
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
|
|
|
|
- script: node build/azure-pipelines/distro/mixin-npm
|
|
|
|
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
|
|
|
|
displayName: Mixin distro node modules
|
2022-08-02 23:26:17 +00:00
|
|
|
|
2021-11-24 12:04:43 +00:00
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt
|
|
|
|
mkdir -p .build/node_modules_cache
|
2023-04-25 06:26:56 +00:00
|
|
|
tar -czf .build/node_modules_cache/cache.tgz --files-from .build/node_modules_list.txt
|
2021-11-24 12:04:43 +00:00
|
|
|
condition: and(succeeded(), ne(variables.NODE_MODULES_RESTORED, 'true'))
|
|
|
|
displayName: Create node_modules archive
|
2020-11-24 10:44:18 +00:00
|
|
|
|
2022-09-21 08:59:57 +00:00
|
|
|
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
|
2023-04-02 07:35:39 +00:00
|
|
|
- script: yarn --cwd build compile && ./.github/workflows/check-clean-git-state.sh
|
|
|
|
displayName: Check /build/ folder
|
2022-05-11 10:08:54 +00:00
|
|
|
|
|
|
|
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
|
2023-04-02 07:35:39 +00:00
|
|
|
- script: node build/azure-pipelines/distro/mixin-quality
|
|
|
|
displayName: Mixin distro quality
|
2022-05-11 10:08:54 +00:00
|
|
|
|
2024-03-21 13:16:32 +00:00
|
|
|
- template: common/install-builtin-extensions.yml@self
|
2021-02-16 10:25:51 +00:00
|
|
|
|
2023-06-08 10:42:40 +00:00
|
|
|
- ${{ if eq(parameters.VSCODE_QUALITY, 'oss') }}:
|
|
|
|
- script: yarn npm-run-all -lp core-ci-pr extensions-ci-pr hygiene eslint valid-layers-check vscode-dts-compile-check tsec-compile-check
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: "$(github-distro-mixin-password)"
|
2023-10-11 16:05:00 +00:00
|
|
|
displayName: Compile & Hygiene (OSS)
|
2023-06-08 10:42:40 +00:00
|
|
|
- ${{ else }}:
|
|
|
|
- script: yarn npm-run-all -lp core-ci extensions-ci hygiene eslint valid-layers-check vscode-dts-compile-check tsec-compile-check
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: "$(github-distro-mixin-password)"
|
2023-10-11 16:05:00 +00:00
|
|
|
displayName: Compile & Hygiene (non-OSS)
|
2022-05-11 10:08:54 +00:00
|
|
|
|
|
|
|
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
|
2023-04-02 07:35:39 +00:00
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
yarn --cwd test/smoke compile
|
|
|
|
yarn --cwd test/integration/browser compile
|
2023-10-11 16:05:00 +00:00
|
|
|
displayName: Compile test suites (non-OSS)
|
2023-04-02 07:35:39 +00:00
|
|
|
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
|
|
|
|
|
|
|
- task: AzureCLI@2
|
2023-10-11 16:05:00 +00:00
|
|
|
displayName: Fetch secrets
|
2023-04-02 07:35:39 +00:00
|
|
|
inputs:
|
|
|
|
azureSubscription: "vscode-builds-subscription"
|
|
|
|
scriptType: pscore
|
|
|
|
scriptLocation: inlineScript
|
|
|
|
addSpnToEnvironment: true
|
|
|
|
inlineScript: |
|
|
|
|
Write-Host "##vso[task.setvariable variable=AZURE_TENANT_ID]$env:tenantId"
|
|
|
|
Write-Host "##vso[task.setvariable variable=AZURE_CLIENT_ID]$env:servicePrincipalId"
|
|
|
|
Write-Host "##vso[task.setvariable variable=AZURE_CLIENT_SECRET;issecret=true]$env:servicePrincipalKey"
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
AZURE_STORAGE_ACCOUNT="ticino" \
|
|
|
|
AZURE_TENANT_ID="$(AZURE_TENANT_ID)" \
|
|
|
|
AZURE_CLIENT_ID="$(AZURE_CLIENT_ID)" \
|
|
|
|
AZURE_CLIENT_SECRET="$(AZURE_CLIENT_SECRET)" \
|
|
|
|
node build/azure-pipelines/upload-sourcemaps
|
2023-10-11 16:05:00 +00:00
|
|
|
displayName: Upload sourcemaps to Azure
|
2023-04-02 07:35:39 +00:00
|
|
|
|
|
|
|
- script: ./build/azure-pipelines/common/extract-telemetry.sh
|
2023-10-11 16:05:00 +00:00
|
|
|
displayName: Generate lists of telemetry events
|
2023-04-02 07:35:39 +00:00
|
|
|
|
|
|
|
- script: tar -cz --ignore-failed-read --exclude='.build/node_modules_cache' --exclude='.build/node_modules_list.txt' --exclude='.build/distro' -f $(Build.ArtifactStagingDirectory)/compilation.tar.gz .build out-* test/integration/browser/out test/smoke/out test/automation/out
|
|
|
|
displayName: Compress compilation artifact
|
|
|
|
|
2024-03-21 13:16:32 +00:00
|
|
|
- task: 1ES.PublishPipelineArtifact@1
|
2023-04-02 07:35:39 +00:00
|
|
|
inputs:
|
|
|
|
targetPath: $(Build.ArtifactStagingDirectory)/compilation.tar.gz
|
|
|
|
artifactName: Compilation
|
2024-03-21 13:16:32 +00:00
|
|
|
sbomEnabled: false
|
2023-04-02 07:35:39 +00:00
|
|
|
displayName: Publish compilation artifact
|
|
|
|
|
|
|
|
- script: yarn download-builtin-extensions-cg
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: "$(github-distro-mixin-password)"
|
2023-10-11 16:05:00 +00:00
|
|
|
displayName: Download component details of built-in extensions
|
2023-04-02 07:35:39 +00:00
|
|
|
|
|
|
|
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
|
|
|
displayName: "Component Detection"
|
|
|
|
inputs:
|
|
|
|
sourceScanPath: $(Build.SourcesDirectory)
|
|
|
|
alertWarningLevel: Medium
|
|
|
|
continueOnError: true
|