diff --git a/script/vsts/platforms/linux.yml b/script/vsts/platforms/linux.yml index 72b1fe704..f66661aa4 100644 --- a/script/vsts/platforms/linux.yml +++ b/script/vsts/platforms/linux.yml @@ -16,7 +16,7 @@ jobs: parameters: OS: linux - - template: templates/linux-bootstrap.yml + - template: templates/bootstrap.yml - script: script/lint displayName: Run linter diff --git a/script/vsts/platforms/macos.yml b/script/vsts/platforms/macos.yml index ec5d7bc22..a7221ccfc 100644 --- a/script/vsts/platforms/macos.yml +++ b/script/vsts/platforms/macos.yml @@ -18,7 +18,7 @@ jobs: parameters: OS: macos - - template: templates/macos-bootstrap.yml + - template: templates/bootstrap.yml - script: script/lint displayName: Run linter @@ -70,6 +70,6 @@ jobs: # The artifact caching task does not work on forks, so we need to # bootstrap again for pull requests coming from forked repositories. - - template: templates/macos-bootstrap.yml + - template: templates/bootstrap.yml - template: templates/macos-test.yml diff --git a/script/vsts/platforms/templates/bootstrap.yml b/script/vsts/platforms/templates/bootstrap.yml new file mode 100644 index 000000000..6b9a6a855 --- /dev/null +++ b/script/vsts/platforms/templates/bootstrap.yml @@ -0,0 +1,24 @@ +steps: + - bash: | + if ["$OS" == "Windows_NT"]; then + node script/vsts/windows-run.js script/bootstrap.cmd + else + script/bootstrap + fi + displayName: Bootstrap build environment + env: + OS: $(Agent.OS) + CI: true + CI_PROVIDER: VSTS + ${{ if eq(variables['Agent.OS'], 'Windows_NT') }}: + NPM_BIN_PATH: C:/hostedtoolcache/windows/node/12.13.1/x64/npm.cmd + BUILD_ARCH: $(buildArch) + ${{ if in(variables['Agent.OS'], 'Darwin', 'Linux') }}: + NPM_BIN_PATH: /usr/local/bin/npm + ${{ if in(variables['Agent.OS'], 'Darwin', 'Windows_NT') }}: + npm_config_build_from_source: true + ${{ if eq(variables['Agent.OS'], 'Linux') }}: + CC: clang-5.0 + CXX: clang++-5.0 + npm_config_clang: 1 + condition: or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true')) diff --git a/script/vsts/platforms/templates/linux-bootstrap.yml b/script/vsts/platforms/templates/linux-bootstrap.yml deleted file mode 100644 index fec228bf3..000000000 --- a/script/vsts/platforms/templates/linux-bootstrap.yml +++ /dev/null @@ -1,10 +0,0 @@ -steps: - - script: script/bootstrap - displayName: Bootstrap build environment - env: - CI: true - CI_PROVIDER: VSTS - CC: clang-5.0 - CXX: clang++-5.0 - npm_config_clang: 1 - condition: or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true')) diff --git a/script/vsts/platforms/templates/macos-bootstrap.yml b/script/vsts/platforms/templates/macos-bootstrap.yml deleted file mode 100644 index f78c3e940..000000000 --- a/script/vsts/platforms/templates/macos-bootstrap.yml +++ /dev/null @@ -1,9 +0,0 @@ -steps: - - script: script/bootstrap - displayName: Bootstrap build environment - env: - CI: true - CI_PROVIDER: VSTS - NPM_BIN_PATH: /usr/local/bin/npm - npm_config_build_from_source: true - condition: or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true')) diff --git a/script/vsts/platforms/templates/windows-bootstrap.yml b/script/vsts/platforms/templates/windows-bootstrap.yml deleted file mode 100644 index 31aa73195..000000000 --- a/script/vsts/platforms/templates/windows-bootstrap.yml +++ /dev/null @@ -1,11 +0,0 @@ -steps: - - script: | - node script\vsts\windows-run.js script\bootstrap.cmd - env: - BUILD_ARCH: $(buildArch) - CI: true - CI_PROVIDER: VSTS - NPM_BIN_PATH: "C:\\hostedtoolcache\\windows\\node\\12.13.1\\x64\\npm.cmd" - npm_config_build_from_source: true - displayName: Bootstrap build environment - condition: or(ne(variables['MainNodeModulesRestored'], 'true'), ne(variables['ScriptNodeModulesRestored'], 'true'), ne(variables['ApmNodeModulesRestored'], 'true')) diff --git a/script/vsts/platforms/windows.yml b/script/vsts/platforms/windows.yml index a978fee30..5c17b6063 100644 --- a/script/vsts/platforms/windows.yml +++ b/script/vsts/platforms/windows.yml @@ -26,7 +26,7 @@ jobs: parameters: OS: windows - - template: templates/windows-bootstrap.yml + - template: templates/bootstrap.yml - script: node script\vsts\windows-run.js script\lint.cmd env: