Use .nvmrc file for setting up Node version in Actions

This commit is contained in:
Koen Vlaswinkel 2023-10-04 10:00:56 +02:00
Родитель ff34079247
Коммит c970c3bc19
4 изменённых файлов: 13 добавлений и 13 удалений

2
.github/workflows/cli-test.yml поставляемый
Просмотреть файл

@ -62,7 +62,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '18.15.0'
node-version-file: extensions/ql-vscode/.nvmrc
cache: 'npm'
cache-dependency-path: extensions/ql-vscode/package-lock.json

12
.github/workflows/main.yml поставляемый
Просмотреть файл

@ -22,7 +22,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '18.15.0'
node-version-file: extensions/ql-vscode/.nvmrc
cache: 'npm'
cache-dependency-path: extensions/ql-vscode/package-lock.json
@ -64,7 +64,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '18.15.0'
node-version-file: extensions/ql-vscode/.nvmrc
cache: 'npm'
cache-dependency-path: extensions/ql-vscode/package-lock.json
@ -110,7 +110,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '18.15.0'
node-version-file: extensions/ql-vscode/.nvmrc
cache: 'npm'
cache-dependency-path: extensions/ql-vscode/package-lock.json
@ -149,7 +149,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '18.15.0'
node-version-file: extensions/ql-vscode/.nvmrc
cache: 'npm'
cache-dependency-path: extensions/ql-vscode/package-lock.json
@ -183,7 +183,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '18.15.0'
node-version-file: extensions/ql-vscode/.nvmrc
cache: 'npm'
cache-dependency-path: extensions/ql-vscode/package-lock.json
@ -251,7 +251,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '18.15.0'
node-version-file: extensions/ql-vscode/.nvmrc
cache: 'npm'
cache-dependency-path: extensions/ql-vscode/package-lock.json

2
.github/workflows/release.yml поставляемый
Просмотреть файл

@ -22,7 +22,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '18.15.0'
node-version-file: extensions/ql-vscode/.nvmrc
- name: Install dependencies
run: |

Просмотреть файл

@ -15,14 +15,14 @@ You can find this info by seleting "About Visual Studio Code" from the top menu.
The following files will need to be updated:
- `.github/workflows/cli-test.yml` - the "node-version: '[VERSION]'" setting
- `.github/workflows/main.yml` - all the "node-version: '[VERSION]'" settings
- `.github/workflows/release.yml` - the "node-version: '[VERSION]'" setting
- `extensions/ql-vscode/.nvmrc` - this will enable nvm to automatically switch to the correct node version when you're in the project folder
- `extensions/ql-vscode/package-lock.json` - the "engines.node: '[VERSION]'" setting
- `extensions/ql-vscode/.nvmrc` - this will enable nvm to automatically switch to the correct Node
version when you're in the project folder. It will also change the Node version the GitHub Actions
workflows use.
- `extensions/ql-vscode/package.json` - the "engines.node: '[VERSION]'" setting
- `extensions/ql-vscode/package.json` - the "@types/node: '[VERSION]'" dependency
Then run `npm install` to update the `extensions/ql-vscode/package-lock.json` file.
## Node.js version used in tests
Unit tests will use whatever version of Node.js is installed locally. In CI this will be the version specified in the workflow.