Skip to content

Commit 614334b

Browse files
chore: Use .nvmrc for Node version in CI/CD workflows and npm install in post-checkout hook (#92)
* Use .nvmrc for Node version in CI/CD workflows and npm install in post-checkout hook - Update all workflow files (ci.yml, package.yml, deps.yml, copilot-setup-steps.yml) to use node-version-file: '.nvmrc' instead of hardcoded NODE_VERSION - Remove NODE_VERSION environment variable from workflow files - Change post-checkout hook from npm ci to npm install for local development - All CI workflows continue to use npm ci as expected * Update npm ci to npm install everywhere except CI workflow files Changes: - Updated CD workflow (package.yml) to use npm install - Updated deps workflow (deps.yml) to use npm install - Updated copilot-setup-steps workflow to use npm install - Updated GitHub actions (npm-ci, build-vsix) to use npm install - Updated Azure pipeline files (stable, pre-release) to use npm install - Updated devcontainer files to use npm install in comments - CI workflow files (ci.yml) continue to use npm ci as expected This ensures npm ci is only used in CI environments where reproducible builds are critical, while npm install is used everywhere else for flexibility. * Revert workflow files back to npm ci CI workflow files should use npm ci for reproducible builds: - package.yml (CD workflow) - deps.yml (dependency checking) - copilot-setup-steps.yml Non-workflow files continue to use npm install: - GitHub actions (npm-ci, build-vsix) - Azure pipelines (stable, pre-release) - Post-checkout git hook - Devcontainer files * Revert GitHub actions and Azure pipelines back to npm ci All build and deployment pipelines should use npm ci for reproducible builds: - .github/actions/npm-ci/action.yml - .github/actions/build-vsix/action.yml - build/azure-pipeline.stable.yml - build/azure-pipeline.pre-release.yml Only the post-checkout git hook and devcontainer files now use npm install. * Update CONTRIBUTING.md to use npm install for local development Changed all references from npm ci to npm install in documentation: - Setup instructions - Typical workflow example - Local build instructions This aligns with the change to use npm install for local development while CI workflows continue to use npm ci for reproducible builds. --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 9e00675 commit 614334b

File tree

8 files changed

+18
-28
lines changed

8 files changed

+18
-28
lines changed

.devcontainer/dev-with-python/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
"mounts": ["source=${localWorkspaceFolder},target=/workspaces/local,type=bind,consistency=cached"],
3535
// Use 'postCreateCommand' to run commands after the container is created.
36-
// "postCreateCommand": "npm ci",
36+
// "postCreateCommand": "npm install",
3737
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
3838
"remoteUser": "vscode"
3939
}

.devcontainer/dev/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"mounts": ["source=${localWorkspaceFolder},target=/workspaces/local,type=bind,consistency=cached"]
2121
// Use 'postCreateCommand' to run commands after the container is created.
22-
// "postCreateCommand": "npm ci",
22+
// "postCreateCommand": "npm install",
2323
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
2424
// , "remoteUser": "vscode"
2525
}

.github/workflows/ci.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ on:
77
branches: [main]
88
workflow_dispatch:
99

10-
env:
11-
NODE_VERSION: 22.x
12-
1310
permissions:
1411
actions: read
1512
contents: read
@@ -32,7 +29,7 @@ jobs:
3229
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
3330
with:
3431
cache: 'npm'
35-
node-version: ${{ env.NODE_VERSION }}
32+
node-version-file: '.nvmrc'
3633
registry-url: 'https://npm.pkg.github.com'
3734
scope: '@deepnote'
3835

@@ -59,7 +56,7 @@ jobs:
5956
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
6057
with:
6158
cache: 'npm'
62-
node-version: ${{ env.NODE_VERSION }}
59+
node-version-file: '.nvmrc'
6360
registry-url: 'https://npm.pkg.github.com'
6461
scope: '@deepnote'
6562

@@ -107,7 +104,7 @@ jobs:
107104
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
108105
with:
109106
cache: 'npm'
110-
node-version: ${{ env.NODE_VERSION }}
107+
node-version-file: '.nvmrc'
111108
registry-url: 'https://npm.pkg.github.com'
112109
scope: '@deepnote'
113110

@@ -157,7 +154,7 @@ jobs:
157154
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
158155
with:
159156
cache: 'npm'
160-
node-version: ${{ env.NODE_VERSION }}
157+
node-version-file: '.nvmrc'
161158
registry-url: 'https://npm.pkg.github.com'
162159
scope: '@deepnote'
163160

@@ -181,7 +178,7 @@ jobs:
181178
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
182179
with:
183180
cache: 'npm'
184-
node-version: ${{ env.NODE_VERSION }}
181+
node-version-file: '.nvmrc'
185182
registry-url: 'https://npm.pkg.github.com'
186183
scope: '@deepnote'
187184

@@ -205,7 +202,7 @@ jobs:
205202
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
206203
with:
207204
cache: 'npm'
208-
node-version: ${{ env.NODE_VERSION }}
205+
node-version-file: '.nvmrc'
209206
registry-url: 'https://npm.pkg.github.com'
210207
scope: '@deepnote'
211208

@@ -229,7 +226,7 @@ jobs:
229226
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
230227
with:
231228
cache: 'npm'
232-
node-version: ${{ env.NODE_VERSION }}
229+
node-version-file: '.nvmrc'
233230
registry-url: 'https://npm.pkg.github.com'
234231
scope: '@deepnote'
235232

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ on:
1212
- .github/workflows/copilot-setup-steps.yml
1313

1414
env:
15-
NODE_VERSION: 22.15.1
1615
NPM_VERSION: 10.9.2
1716
PYTHON_VERSION: 3.12
1817
DENO_VERSION: '~1.37'
@@ -42,7 +41,7 @@ jobs:
4241
- name: Use Node ${{env.NODE_VERSION}}
4342
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
4443
with:
45-
node-version: ${{env.NODE_VERSION}}
44+
node-version-file: '.nvmrc'
4645
registry-url: 'https://npm.pkg.github.com'
4746
scope: '@deepnote'
4847

.github/workflows/deps.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
- cron: '0 9 * * 1'
77
workflow_dispatch:
88

9-
env:
10-
NODE_VERSION: 22.x
11-
129
permissions:
1310
actions: read
1411
contents: read
@@ -30,7 +27,7 @@ jobs:
3027
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
3128
with:
3229
cache: 'npm'
33-
node-version: ${{ env.NODE_VERSION }}
30+
node-version-file: '.nvmrc'
3431
registry-url: 'https://npm.pkg.github.com'
3532
scope: '@deepnote'
3633

@@ -62,7 +59,7 @@ jobs:
6259
- name: Setup Node.js
6360
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
6461
with:
65-
node-version: ${{ env.NODE_VERSION }}
62+
node-version-file: '.nvmrc'
6663
cache: 'npm'
6764

6865
- name: Install dependencies

.github/workflows/package.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ on:
77
branches: [main]
88
workflow_dispatch:
99

10-
env:
11-
NODE_VERSION: 22.x
12-
1310
permissions:
1411
contents: read
1512
packages: read
@@ -31,7 +28,7 @@ jobs:
3128
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
3229
with:
3330
cache: 'npm'
34-
node-version: ${{ env.NODE_VERSION }}
31+
node-version-file: '.nvmrc'
3532
registry-url: 'https://npm.pkg.github.com'
3633
scope: '@deepnote'
3734

.husky/post-checkout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npm ci
1+
npm install

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The `@deepnote/blocks` package is published on GitHub Packages. To install it, y
5858
```
5959
Replace `YOUR_TOKEN_HERE` with your actual token.
6060

61-
After completing these steps, you can install dependencies normally with `npm ci`. The project's `.npmrc` file is already configured to use GitHub Packages for the `@deepnote` scope.
61+
After completing these steps, you can install dependencies normally with `npm install`. The project's `.npmrc` file is already configured to use GitHub Packages for the `@deepnote` scope.
6262

6363
On Apple Silicon, you will have to use system versions of `libsodium` and `libzmq` instead of the bundled ones:
6464

@@ -78,7 +78,7 @@ npm_config_build_from_source=true npm install zeromq@
7878
Install the dependecies:
7979

8080
```shell
81-
npm ci
81+
npm install
8282
# Run this to setup the necessary pre-commit hooks.
8383
npm run setup-precommit-hook
8484
python3 -m venv .venv
@@ -277,7 +277,7 @@ Here's an example of a typical workflow:
277277

278278
1. Sync to main (get your fork's main to match vscode-jupyter's main)
279279
1. Create branch
280-
1. `npm ci`
280+
1. `npm install`
281281
1. `npm run clean`
282282
1. Start VS code Insiders root
283283
1. CTRL+SHIFT+B (run the task `compile`)
@@ -354,7 +354,7 @@ Steps to build the extension on your machine once you've cloned the repo:
354354
```bash
355355
> npm install -g @vscode/vsce
356356
# Perform the next steps in the vscode-jupyter folder.
357-
> npm ci
357+
> npm install
358358
> npm run clean
359359
> npm run package # This step takes around 10 minutes.
360360
```

0 commit comments

Comments
 (0)