Skip to content

Commit ef6f0ca

Browse files
committed
CI: Use npm ci rather than npm install
`npm ci` doesn't try to reconcile package.json with package-lock.json, nor with any existing packages in `node_modules`. `npm ci` simply deletes `node_modules` and uses the packages from `package-lock.json`. As a result, `npm ci` is much, much faster than `npm install`. We should use it whenever it is possible and appropriate to do so.
1 parent 3793939 commit ef6f0ca

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

script/vsts/nightly-release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ jobs:
44
vmImage: 'ubuntu-latest'
55
steps:
66
# This has to be done separately because VSTS inexplicably
7-
# exits the script block after `npm install` completes.
7+
# exits the script block after `npm ci` completes.
88
- script: |
99
cd script/vsts
10-
npm install
11-
displayName: npm install
10+
npm ci
11+
displayName: npm ci
1212
- script: node script/vsts/get-release-version.js --nightly
1313
name: Version
1414
env:
@@ -38,11 +38,11 @@ jobs:
3838
- template: platforms/templates/preparation.yml
3939

4040
#This has to be done separately because VSTS inexplicably
41-
#exits the script block after `npm install` completes.
41+
#exits the script block after `npm ci` completes.
4242
- script: |
4343
cd script/vsts
44-
npm install
45-
displayName: npm install
44+
npm ci
45+
displayName: npm ci
4646
4747
- task: DownloadBuildArtifacts@0
4848
inputs:
@@ -77,8 +77,8 @@ jobs:
7777

7878
- script: |
7979
cd script/lib
80-
npm install
81-
displayName: npm install
80+
npm ci
81+
displayName: npm ci
8282
- script: |
8383
cd script/lib/update-dependency
8484
node index.js

script/vsts/pull-requests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ jobs:
66
vmImage: 'ubuntu-latest'
77
steps:
88
# This has to be done separately because VSTS inexplicably
9-
# exits the script block after `npm install` completes.
9+
# exits the script block after `npm ci` completes.
1010
- script: |
1111
cd script/vsts
12-
npm install
13-
displayName: npm install
12+
npm ci
13+
displayName: npm ci
1414
- script: node script/vsts/get-release-version.js
1515
name: Version
1616
env:

script/vsts/release-branch-build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
vmImage: 'ubuntu-latest'
1111
steps:
1212
# This has to be done separately because VSTS inexplicably
13-
# exits the script block after `npm install` completes.
13+
# exits the script block after `npm ci` completes.
1414
- script: |
1515
cd script/vsts
16-
npm install
17-
displayName: npm install
16+
npm ci
17+
displayName: npm ci
1818
- script: node script/vsts/get-release-version.js
1919
name: Version
2020
env:
@@ -43,13 +43,13 @@ jobs:
4343

4444
steps:
4545
# This has to be done separately because VSTS inexplicably
46-
# exits the script block after `npm install` completes.
46+
# exits the script block after `npm ci` completes.
4747
- script: |
4848
cd script/vsts
49-
npm install
49+
npm ci
5050
env:
5151
GITHUB_TOKEN: $(GITHUB_TOKEN)
52-
displayName: npm install
52+
displayName: npm ci
5353
5454
- task: DownloadBuildArtifacts@0
5555
inputs:

0 commit comments

Comments
 (0)