From 8c173ce87e395657439030a07308059b22a160a0 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 9 Jul 2020 01:28:47 -0500 Subject: [PATCH] cache2 on macos --- script/vsts/platforms/macos.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/script/vsts/platforms/macos.yml b/script/vsts/platforms/macos.yml index fe03dce7d2a..a9f817cb129 100644 --- a/script/vsts/platforms/macos.yml +++ b/script/vsts/platforms/macos.yml @@ -26,7 +26,16 @@ jobs: keyfile: 'package.json, script/vsts/platforms/macos.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json' targetfolder: '**/node_modules, !**/node_modules/**/node_modules' vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2' - + + - task: Cache@2 + inputs: + key: 'Bootstrapped | "$(Agent.OS)" | package-lock.json' + restoreKeys: | + Bootstrapped | "$(Agent.OS)" + path: "." + cacheHitVar: CacheRestored + displayName: Cache Bootstrapped repository + - script: script/bootstrap displayName: Bootstrap build environment env: @@ -36,13 +45,6 @@ jobs: npm_config_build_from_source: true condition: ne(variables['CacheRestored'], 'true') - - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 - displayName: Save node_modules cache - inputs: - keyfile: 'package.json, script/vsts/platforms/macos.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json' - targetfolder: '**/node_modules, !**/node_modules/**/node_modules' - vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2' - - script: script/lint displayName: Run linter @@ -121,12 +123,14 @@ jobs: - script: npm install --global npm@6.12.1 displayName: Update npm - - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 - displayName: Restore node_modules cache + + - task: Cache@2 inputs: - keyfile: 'package.json, script/vsts/platforms/macos.yml, **/package-lock.json, !**/node_modules/**/package-lock.json, !**/.*/**/package-lock.json' - targetfolder: '**/node_modules, !**/node_modules/**/node_modules' - vstsFeed: 'bae1bc26-220d-43c7-a955-4de039370de2' + key: 'Bootstrapped | "$(Agent.OS)" | package-lock.json' + restoreKeys: | + Bootstrapped | "$(Agent.OS)" + path: "." + condition: ne(variables['CacheRestored'], 'true') # The artifact caching task does not work on forks, so we need to # bootstrap again for pull requests coming from forked repositories.