|
26 | 26 | keyfile: 'package.json, script/vsts/platforms/macos.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json' |
27 | 27 | targetfolder: '**/node_modules, !**/node_modules/**/node_modules' |
28 | 28 | vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2' |
29 | | - |
| 29 | + |
| 30 | + - task: Cache@2 |
| 31 | + inputs: |
| 32 | + key: 'Bootstrapped | "$(Agent.OS)" | package-lock.json' |
| 33 | + restoreKeys: | |
| 34 | + Bootstrapped | "$(Agent.OS)" |
| 35 | + path: "." |
| 36 | + cacheHitVar: CacheRestored |
| 37 | + displayName: Cache Bootstrapped repository |
| 38 | + |
30 | 39 | - script: script/bootstrap |
31 | 40 | displayName: Bootstrap build environment |
32 | 41 | env: |
|
36 | 45 | npm_config_build_from_source: true |
37 | 46 | condition: ne(variables['CacheRestored'], 'true') |
38 | 47 |
|
39 | | - - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 |
40 | | - displayName: Save node_modules cache |
41 | | - inputs: |
42 | | - keyfile: 'package.json, script/vsts/platforms/macos.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json' |
43 | | - targetfolder: '**/node_modules, !**/node_modules/**/node_modules' |
44 | | - vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2' |
45 | | - |
46 | 48 | - script: script/lint |
47 | 49 | displayName: Run linter |
48 | 50 |
|
@@ -121,12 +123,14 @@ jobs: |
121 | 123 | - script: npm install --global [email protected] |
122 | 124 | displayName: Update npm |
123 | 125 |
|
124 | | - - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 |
125 | | - displayName: Restore node_modules cache |
| 126 | + |
| 127 | + - task: Cache@2 |
126 | 128 | inputs: |
127 | | - keyfile: 'package.json, script/vsts/platforms/macos.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json' |
128 | | - targetfolder: '**/node_modules, !**/node_modules/**/node_modules' |
129 | | - vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2' |
| 129 | + key: 'Bootstrapped | "$(Agent.OS)" | package-lock.json' |
| 130 | + restoreKeys: | |
| 131 | + Bootstrapped | "$(Agent.OS)" |
| 132 | + path: "." |
| 133 | + condition: ne(variables['CacheRestored'], 'true') |
130 | 134 |
|
131 | 135 | # The artifact caching task does not work on forks, so we need to |
132 | 136 | # bootstrap again for pull requests coming from forked repositories. |
|
0 commit comments