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
parent ff34079247
commit c970c3bc19
4 changed files with 13 additions and 13 deletions

View File

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

View File

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

View File

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

View File

@@ -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: The following files will need to be updated:
- `.github/workflows/cli-test.yml` - the "node-version: '[VERSION]'" setting - `extensions/ql-vscode/.nvmrc` - this will enable nvm to automatically switch to the correct Node
- `.github/workflows/main.yml` - all the "node-version: '[VERSION]'" settings version when you're in the project folder. It will also change the Node version the GitHub Actions
- `.github/workflows/release.yml` - the "node-version: '[VERSION]'" setting workflows use.
- `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/package.json` - the "engines.node: '[VERSION]'" setting - `extensions/ql-vscode/package.json` - the "engines.node: '[VERSION]'" setting
- `extensions/ql-vscode/package.json` - the "@types/node: '[VERSION]'" dependency - `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 ## 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. Unit tests will use whatever version of Node.js is installed locally. In CI this will be the version specified in the workflow.