Skip to content

Commit 2de7f0c

Browse files
committed
Attempt to use npm caching
1 parent 0b1f63d commit 2de7f0c

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

azure-pipelines.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,20 @@ steps:
3737
checkLatest: true
3838
displayName: "Install Node.js"
3939

40-
- script: |
41-
npm install
42-
displayName: "NPM install"
40+
- task: Cache@2
41+
displayName: Cache node_modules
42+
inputs:
43+
key: 'npm | "$(Agent.OS)" | $(Build.SourcesDirectory)/package-lock.json'
44+
path: $(Build.SourcesDirectory)/node_modules
45+
cacheHitVar: CACHE_RESTORED
46+
47+
- task: Npm@1
48+
displayName: "Install the dependencies"
49+
inputs:
50+
command: custom
51+
verbose: false
52+
customCommand: "ci"
53+
condition: ne(variables.CACHE_RESTORED, 'true')
4354

4455
- script: |
4556
npm test
@@ -81,6 +92,6 @@ steps:
8192
condition: ne(variables['Build.SourceBranch'], 'refs/heads/master')
8293
displayName: Publish react-spaces (BETA)
8394
inputs:
84-
command: 'custom'
85-
customCommand: 'run publish:beta'
86-
customEndpoint: 'NPM'
95+
command: "custom"
96+
customCommand: "run publish:beta"
97+
customEndpoint: "NPM"

0 commit comments

Comments
 (0)