using cache template in the workflows

This commit is contained in:
aminya 2020-07-10 22:08:37 -05:00
parent bcc9e1d11b
commit 22858b9723
3 changed files with 12 additions and 80 deletions

View File

@ -30,26 +30,9 @@ jobs:
- script: npm install --global npm@6.12.1
displayName: Update npm
- task: Cache@2
displayName: Cache node_modules
inputs:
key: 'npm | "$(Agent.OS)" | package.json, package-lock.json, script/vsts/platforms/linux.yml'
path: 'node_modules'
cacheHitVar: MainNodeModulesRestored
- task: Cache@2
displayName: Cache script/node_modules
inputs:
key: 'npm | "$(Agent.OS)" | script/package.json, script/package-lock.json, script/vsts/platforms/linux.yml'
path: 'script/node_modules'
cacheHitVar: ScriptNodeModulesRestored
- task: Cache@2
displayName: Cache apm/node_modules
inputs:
key: 'npm | "$(Agent.OS)" | apm/package.json, apm/package-lock.json, script/vsts/platforms/linux.yml'
path: 'apm/node_modules'
cacheHitVar: ApmNodeModulesRestored
- template: cache.yml
parameters:
OS: linux
- script: script/bootstrap
displayName: Bootstrap build environment

View File

@ -20,26 +20,9 @@ jobs:
- script: npm install --global npm@6.12.1
displayName: Update npm
- task: Cache@2
displayName: Cache node_modules
inputs:
key: 'npm | "$(Agent.OS)" | package.json, package-lock.json, script/vsts/platforms/macos.yml'
path: 'node_modules'
cacheHitVar: MainNodeModulesRestored
- task: Cache@2
displayName: Cache script/node_modules
inputs:
key: 'npm | "$(Agent.OS)" | script/package.json, script/package-lock.json, script/vsts/platforms/macos.yml'
path: 'script/node_modules'
cacheHitVar: ScriptNodeModulesRestored
- task: Cache@2
displayName: Cache apm/node_modules
inputs:
key: 'npm | "$(Agent.OS)" | apm/package.json, apm/package-lock.json, script/vsts/platforms/macos.yml'
path: 'apm/node_modules'
cacheHitVar: ApmNodeModulesRestored
- template: cache.yml
parameters:
OS: macos
- script: script/bootstrap
displayName: Bootstrap build environment
@ -128,26 +111,9 @@ jobs:
- script: npm install --global npm@6.12.1
displayName: Update npm
- task: Cache@2
displayName: Cache node_modules
inputs:
key: 'npm | "$(Agent.OS)" | package.json, package-lock.json, script/vsts/platforms/macos.yml'
path: 'node_modules'
cacheHitVar: MainNodeModulesRestored
- task: Cache@2
displayName: Cache script/node_modules
inputs:
key: 'npm | "$(Agent.OS)" | script/package.json, script/package-lock.json, script/vsts/platforms/macos.yml'
path: 'script/node_modules'
cacheHitVar: ScriptNodeModulesRestored
- task: Cache@2
displayName: Cache apm/node_modules
inputs:
key: 'npm | "$(Agent.OS)" | apm/package.json, apm/package-lock.json, script/vsts/platforms/macos.yml'
path: 'apm/node_modules'
cacheHitVar: ApmNodeModulesRestored
- template: cache.yml
parameters:
OS: macos
# The artifact caching task does not work on forks, so we need to
# bootstrap again for pull requests coming from forked repositories.

View File

@ -48,26 +48,9 @@ jobs:
npm install
displayName: Install Windows build dependencies
- task: Cache@2
displayName: Cache node_modules
inputs:
key: 'npm | "$(Agent.OS)" | "$(buildArch)" | package.json, package-lock.json, script/vsts/platforms/windows.yml'
path: 'node_modules'
cacheHitVar: MainNodeModulesRestored
- task: Cache@2
displayName: Cache script/node_modules
inputs:
key: 'npm | "$(Agent.OS)" | "$(buildArch)" | script/package.json, script/package-lock.json, script/vsts/platforms/windows.yml'
path: 'script/node_modules'
cacheHitVar: ScriptNodeModulesRestored
- task: Cache@2
displayName: Cache apm/node_modules
inputs:
key: 'npm | "$(Agent.OS)" | "$(buildArch)" | apm/package.json, apm/package-lock.json, script/vsts/platforms/windows.yml'
path: 'apm/node_modules'
cacheHitVar: ApmNodeModulesRestored
- template: cache.yml
parameters:
OS: windows
- script: |
node script\vsts\windows-run.js script\bootstrap.cmd