Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions script/vsts/platforms/cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
parameters:
- name: OS
displayName: Operating System
type: string
values:
- windows
- linux
- macos

steps:
- task: Cache@2
displayName: Cache node_modules
inputs:
key: 'npm | "$(Agent.OS)" | "$(buildArch)" | package.json, package-lock.json, script/vsts/platforms/${{ parameters.OS }}.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/${{ parameters.OS }}.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/${{ parameters.OS }}.yml'
path: 'apm/node_modules'
cacheHitVar: ApmNodeModulesRestored
23 changes: 3 additions & 20 deletions script/vsts/platforms/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
46 changes: 6 additions & 40 deletions script/vsts/platforms/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
23 changes: 3 additions & 20 deletions script/vsts/platforms/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down