Use .nvmrc file for setting up Node version in Actions
This commit is contained in:
2
.github/workflows/cli-test.yml
vendored
2
.github/workflows/cli-test.yml
vendored
@@ -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
|
||||||
|
|
||||||
|
|||||||
12
.github/workflows/main.yml
vendored
12
.github/workflows/main.yml
vendored
@@ -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
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -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: |
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user