Skip to content

Commit fdfff5d

Browse files
committed
CI: Better cache restoreKeys
Allow restoring cache even if package.json or package-lock.json have changed. `npm install` should be able to sort out the updated packages.
1 parent e0b2911 commit fdfff5d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

script/vsts/platforms/templates/cache.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ steps:
1313
inputs:
1414
key: 'npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | package.json, package-lock.json, script/vsts/platforms/templates/preparation.yml, script/vsts/platforms/${{ parameters.OS }}.yml'
1515
restoreKeys: |
16-
npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | package.json, package-lock.json
17-
npm | "$(Agent.OS)" | "$(BUILD_ARCH)"
16+
npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | package.json, script/vsts/platforms/templates/preparation.yml, script/vsts/platforms/${{ parameters.OS }}.yml
17+
npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | script/vsts/platforms/templates/preparation.yml, script/vsts/platforms/${{ parameters.OS }}.yml
1818
path: 'node_modules'
1919
cacheHitVar: MainNodeModulesRestored
2020

@@ -23,8 +23,8 @@ steps:
2323
inputs:
2424
key: 'npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | script/package.json, script/package-lock.json, script/vsts/platforms/templates/preparation.yml, script/vsts/platforms/${{ parameters.OS }}.yml'
2525
restoreKeys: |
26-
npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | script/package.json, script/package-lock.json
27-
npm | "$(Agent.OS)" | "$(BUILD_ARCH)"
26+
npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | script/package.json, script/vsts/platforms/templates/preparation.yml, script/vsts/platforms/${{ parameters.OS }}.yml
27+
npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | script/vsts/platforms/templates/preparation.yml, script/vsts/platforms/${{ parameters.OS }}.yml
2828
path: 'script/node_modules'
2929
cacheHitVar: ScriptNodeModulesRestored
3030

@@ -33,7 +33,7 @@ steps:
3333
inputs:
3434
key: 'npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | apm/package.json, apm/package-lock.json, script/vsts/platforms/templates/preparation.yml, script/vsts/platforms/${{ parameters.OS }}.yml'
3535
restoreKeys: |
36-
npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | apm/package.json, apm/package-lock.json
37-
npm | "$(Agent.OS)" | "$(BUILD_ARCH)"
36+
npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | apm/package.json, script/vsts/platforms/templates/preparation.yml, script/vsts/platforms/${{ parameters.OS }}.yml
37+
npm | "$(Agent.OS)" | "$(BUILD_ARCH)" | script/vsts/platforms/templates/preparation.yml, script/vsts/platforms/${{ parameters.OS }}.yml
3838
path: 'apm/node_modules'
3939
cacheHitVar: ApmNodeModulesRestored

0 commit comments

Comments
 (0)