-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Use Cache@2 task in place of Lighthouse
- Loading branch information
Showing
3 changed files
with
78 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,12 +30,26 @@ jobs: | |
- script: npm install --global [email protected] | ||
displayName: Update npm | ||
|
||
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 | ||
displayName: Restore node_modules cache | ||
- task: Cache@2 | ||
displayName: Cache node_modules | ||
inputs: | ||
keyfile: 'package.json, script/vsts/platforms/linux.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: '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 | ||
|
||
- script: script/bootstrap | ||
displayName: Bootstrap build environment | ||
|
@@ -45,14 +59,7 @@ jobs: | |
CC: clang-5.0 | ||
CXX: clang++-5.0 | ||
npm_config_clang: 1 | ||
condition: ne(variables['CacheRestored'], 'true') | ||
|
||
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 | ||
displayName: Save node_modules cache | ||
inputs: | ||
keyfile: 'package.json, script/vsts/platforms/linux.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' | ||
condition: or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true')) | ||
|
||
- script: script/lint | ||
displayName: Run linter | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,26 @@ jobs: | |
- script: npm install --global [email protected] | ||
displayName: Update npm | ||
|
||
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 | ||
displayName: Restore node_modules cache | ||
- task: Cache@2 | ||
displayName: Cache node_modules | ||
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: '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 | ||
|
||
- script: script/bootstrap | ||
displayName: Bootstrap build environment | ||
|
@@ -34,14 +48,7 @@ jobs: | |
CI_PROVIDER: VSTS | ||
NPM_BIN_PATH: /usr/local/bin/npm | ||
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' | ||
condition: or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true')) | ||
|
||
- script: script/lint | ||
displayName: Run linter | ||
|
@@ -121,12 +128,26 @@ jobs: | |
- script: npm install --global [email protected] | ||
displayName: Update npm | ||
|
||
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 | ||
displayName: Restore node_modules cache | ||
- task: Cache@2 | ||
displayName: Cache node_modules | ||
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: '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 | ||
|
||
# The artifact caching task does not work on forks, so we need to | ||
# bootstrap again for pull requests coming from forked repositories. | ||
|
@@ -137,8 +158,7 @@ jobs: | |
CI_PROVIDER: VSTS | ||
NPM_BIN_PATH: /usr/local/bin/npm | ||
npm_config_build_from_source: true | ||
|
||
condition: ne(variables['CacheRestored'], 'true') | ||
condition: or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true')) | ||
|
||
- task: DownloadBuildArtifacts@0 | ||
displayName: Download atom-mac.zip | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters