Test using nvmrc in CI (#194836)

* Test using nvmrc in CI

* Force run yarn

* fix

* Bump nvmrc to latest

* Revert "Force run yarn"

This reverts commit af741f37d5.

* Make all jobs use node from nvmrc
And install node-gyp where needed
pull/194857/head
Rob Lourens 2023-10-04 19:08:50 -07:00 committed by GitHub
parent b96b558f64
commit 7d4027b62b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 62 additions and 35 deletions

View File

@ -31,7 +31,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: .nvmrc
- name: Compute node modules cache key
id: nodeModulesCacheKey
@ -83,7 +83,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: .nvmrc
- name: Compute node modules cache key
id: nodeModulesCacheKey
@ -145,7 +145,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: .nvmrc
- name: Compute node modules cache key
id: nodeModulesCacheKey

View File

@ -25,7 +25,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: .nvmrc
- uses: actions/setup-python@v4
with:
@ -115,7 +115,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: .nvmrc
- name: Compute node modules cache key
id: nodeModulesCacheKey
@ -186,7 +186,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: .nvmrc
- name: Compute node modules cache key
id: nodeModulesCacheKey
@ -258,7 +258,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: .nvmrc
- name: Compute node modules cache key
id: nodeModulesCacheKey

View File

@ -22,7 +22,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18.15
node-version-file: .nvmrc
- name: Compute node modules cache key
id: nodeModulesCacheKey
@ -53,7 +53,9 @@ jobs:
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
run: yarn --frozen-lockfile --network-timeout 180000
run: |
npm i -g node-gyp@9.4.0
yarn --frozen-lockfile --network-timeout 180000
- name: Download Playwright
run: yarn playwright-install

View File

@ -23,7 +23,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
node-version-file: .nvmrc
- name: Install dependencies
if: steps.caching-stage.outputs.cache-hit != 'true'

2
.nvmrc
View File

@ -1 +1 @@
18.15
18.18

View File

@ -11,7 +11,8 @@ parameters:
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
# Install yarn as the ARM64 build agent is using vanilla Ubuntu

View File

@ -1,7 +1,8 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- template: ../distro/download-distro.yml

View File

@ -14,7 +14,8 @@ parameters:
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- template: ../cli/cli-apply-patches.yml

View File

@ -7,7 +7,8 @@ parameters:
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- script: node build/setup-npm-registry.js $NPM_REGISTRY build
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))

View File

@ -1,7 +1,8 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- task: UseDotNet@2
inputs:

View File

@ -1,7 +1,8 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- template: ../distro/download-distro.yml

View File

@ -18,7 +18,8 @@ steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- template: ../distro/download-distro.yml
@ -77,7 +78,7 @@ steps:
- script: |
set -e
export npm_config_arch=$(VSCODE_ARCH)
npm i -g node-gyp
npm i -g node-gyp@9.4.0
for i in {1..5}; do # try 5 times
yarn --frozen-lockfile --check-files && break

View File

@ -9,5 +9,6 @@ pr: none
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- template: ./distro/download-distro.yml

View File

@ -17,7 +17,8 @@ parameters:
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- template: ../cli/cli-apply-patches.yml

View File

@ -20,7 +20,8 @@ steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- template: ../distro/download-distro.yml

View File

@ -1,7 +1,8 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- task: DownloadPipelineArtifact@0
displayName: "Download Pipeline Artifact"

View File

@ -5,7 +5,8 @@ steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- script: node build/setup-npm-registry.js $NPM_REGISTRY
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))

View File

@ -5,7 +5,8 @@ steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- powershell: node build/setup-npm-registry.js $env:NPM_REGISTRY
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))

View File

@ -5,7 +5,8 @@ parameters:
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15.x"
versionSource: fromFile
versionFilePath: .nvmrc
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- template: ./distro/download-distro.yml
@ -58,6 +59,8 @@ steps:
- script: |
set -e
npm i -g node-gyp@9.4.0
for i in {1..5}; do # try 5 times
yarn --frozen-lockfile --check-files && break
if [ $i -eq 3 ]; then

View File

@ -1,7 +1,8 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- task: AzureKeyVault@1
displayName: "Azure Key Vault: Get Secrets"

View File

@ -5,7 +5,8 @@ parameters:
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- task: AzureCLI@2
inputs:

View File

@ -12,7 +12,8 @@ pool:
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- bash: |
TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)

View File

@ -52,7 +52,8 @@ stages:
outputFormat: "pre"
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- template: ./distro/download-distro.yml
@ -179,7 +180,8 @@ stages:
toolMajorVersion: "V2"
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- template: ./distro/download-distro.yml

View File

@ -1,7 +1,8 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- template: ../distro/download-distro.yml

View File

@ -17,7 +17,8 @@ parameters:
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- ${{ if ne(parameters.VSCODE_QUALITY, 'oss') }}:
- template: ../cli/cli-apply-patches.yml

View File

@ -10,7 +10,8 @@ steps:
- task: NodeTool@0
displayName: "Use Node.js"
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- powershell: node build/setup-npm-registry.js $env:NPM_REGISTRY build
condition: and(succeeded(), ne(variables['NPM_REGISTRY'], 'none'))

View File

@ -20,7 +20,8 @@ steps:
- task: NodeTool@0
inputs:
versionSpec: "18.15"
versionSource: fromFile
versionFilePath: .nvmrc
- task: UsePythonVersion@0
inputs: