diff --git a/build/ci/templates/globals.yml b/build/ci/templates/globals.yml index f3316f04d335..f4f556097bb9 100644 --- a/build/ci/templates/globals.yml +++ b/build/ci/templates/globals.yml @@ -7,3 +7,5 @@ variables: VSC_PYTHON_FORCE_LOGGING: true # Enable this to turn on console output for the logger VSC_PYTHON_LOG_FILE: '$(Build.ArtifactStagingDirectory)/pvsc.log' CI_BRANCH_NAME: ${Build.SourceBranchName} + npm_config_cache: $(Pipeline.Workspace)/.npm + diff --git a/build/ci/templates/steps/initialization.yml b/build/ci/templates/steps/initialization.yml index c2e0e603667b..2a1bf1b34060 100644 --- a/build/ci/templates/steps/initialization.yml +++ b/build/ci/templates/steps/initialization.yml @@ -73,6 +73,16 @@ steps: # displayName: 'Uninstall canvas and install build from source (only for Linux)' # condition: and(succeeded(), eq(variables['Agent.Os'], 'Linux')) + # See the help here on how to cache npm + # https://docs.microsoft.com/en-us/azure/devops/pipelines/caching/?view=azure-devops#nodejsnpm + - task: CacheBeta@0 + inputs: + key: npm | $(Agent.OS) | package-lock.json + path: $(npm_config_cache) + restoreKeys: | + npm | $(Agent.OS) + displayName: Cache npm + - task: Npm@1 displayName: "npm ci" inputs: