Skip to content

Commit aaa5a90

Browse files
authored
Try caching npm (#8436)
* Attempt to cache node_modules * Change npm ci to install so we can actually cache * Follow directions on devops docs * Move variable and fix spacing * Use restore cache * Put back dependencies
1 parent 8d33e99 commit aaa5a90

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

build/ci/templates/globals.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ variables:
77
VSC_PYTHON_FORCE_LOGGING: true # Enable this to turn on console output for the logger
88
VSC_PYTHON_LOG_FILE: '$(Build.ArtifactStagingDirectory)/pvsc.log'
99
CI_BRANCH_NAME: ${Build.SourceBranchName}
10+
npm_config_cache: $(Pipeline.Workspace)/.npm
11+

build/ci/templates/steps/initialization.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ steps:
7373
# displayName: 'Uninstall canvas and install build from source (only for Linux)'
7474
# condition: and(succeeded(), eq(variables['Agent.Os'], 'Linux'))
7575

76+
# See the help here on how to cache npm
77+
# https://docs.microsoft.com/en-us/azure/devops/pipelines/caching/?view=azure-devops#nodejsnpm
78+
- task: CacheBeta@0
79+
inputs:
80+
key: npm | $(Agent.OS) | package-lock.json
81+
path: $(npm_config_cache)
82+
restoreKeys: |
83+
npm | $(Agent.OS)
84+
displayName: Cache npm
85+
7686
- task: Npm@1
7787
displayName: "npm ci"
7888
inputs:

0 commit comments

Comments
 (0)