Add conditionals to root YAML definition

Prevents running builds (that get skipped) in PR CI, and prevents
running tests (which are irrelevant) in Merge CI.
This commit is contained in:
Joshua M. Boniface 2020-07-06 22:12:39 -04:00
parent 3e53eb1cde
commit aab79ef346

View File

@ -16,11 +16,13 @@ trigger:
jobs: jobs:
- template: azure-pipelines-main.yml - template: azure-pipelines-main.yml
condition: ! or(startsWith(variables['Build.SourceBranch'], 'refs/tags'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master'))
parameters: parameters:
LinuxImage: 'ubuntu-latest' LinuxImage: 'ubuntu-latest'
RestoreBuildProjects: $(RestoreBuildProjects) RestoreBuildProjects: $(RestoreBuildProjects)
- template: azure-pipelines-test.yml - template: azure-pipelines-test.yml
condition: ! or(startsWith(variables['Build.SourceBranch'], 'refs/tags'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master'))
parameters: parameters:
ImageNames: ImageNames:
Linux: 'ubuntu-latest' Linux: 'ubuntu-latest'
@ -28,6 +30,7 @@ jobs:
macOS: 'macos-latest' macOS: 'macos-latest'
- template: azure-pipelines-abi.yml - template: azure-pipelines-abi.yml
condition: ! or(startsWith(variables['Build.SourceBranch'], 'refs/tags'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master'))
parameters: parameters:
Packages: Packages:
Naming: Naming:
@ -45,3 +48,4 @@ jobs:
LinuxImage: 'ubuntu-latest' LinuxImage: 'ubuntu-latest'
- template: azure-pipelines-package.yml - template: azure-pipelines-package.yml
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/tags'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master'))