Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Pipelines: Skip tests if build fails, run both tools even if other fails #1337

Merged
merged 3 commits into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions azure-devops/run-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
jobs:
- job: ${{ parameters.targetPlatform }}
timeoutInMinutes: 360
pool:
name: $(agentPool)
CaseyCarter marked this conversation as resolved.
Show resolved Hide resolved

variables:
buildOutputLocation: 'D:\build\${{ parameters.targetPlatform }}'
Expand Down Expand Up @@ -74,7 +72,7 @@ jobs:
- task: CmdLine@2
displayName: 'Run Tests'
timeoutInMinutes: 120
condition: in('${{ parameters.targetPlatform }}', 'x64', 'x86')
condition: and(succeeded(), in('${{ parameters.targetPlatform }}', 'x64', 'x86'))
inputs:
workingDirectory: $(buildOutputLocation)
script: |
Expand All @@ -85,7 +83,7 @@ jobs:
- task: PublishTestResults@2
displayName: 'Publish Tests'
timeoutInMinutes: 10
condition: in('${{ parameters.targetPlatform }}', 'x64', 'x86')
condition: and(succeededOrFailed(), in('${{ parameters.targetPlatform }}', 'x64', 'x86'))
inputs:
searchFolder: $(buildOutputLocation)
testResultsFormat: JUnit
Expand Down
17 changes: 17 additions & 0 deletions azure-devops/run-tool.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

jobs:
- job : ${{ parameters.name }}
displayName: ${{ parameters.displayName }}
dependsOn: Build_Support_Tools
timeoutInMinutes: ${{ parameters.timeout }}
steps:
- download: current
artifact: ${{ parameters.toolName }}
- task: BatchScript@1
displayName: ${{ parameters.displayName }}
inputs:
filename: ${{ parameters.script }}
failOnStandardError: true
arguments: '$(Pipeline.Workspace)/${{ parameters.toolName }}/${{ parameters.toolName }}.exe'
46 changes: 23 additions & 23 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@
# Build STL targeting x86, x64, arm, arm64

variables:
agentPool: 'StlBuild-2020-09-14'
tmpDir: 'D:\Temp'

pool: 'StlBuild-2020-09-14'

stages:
- stage: Code_Format
displayName: 'Code Format'
jobs:
- job: Code_Format_Validation
timeoutInMinutes: 90
displayName: 'Validation'
pool:
name: $(agentPool)

- job: Build_Support_Tools
displayName: 'Build Support Tools'
timeoutInMinutes: 30
variables:
buildOutputLocation: 'D:\tools'
steps:
Expand All @@ -40,22 +38,24 @@ stages:
cmake --build $(buildOutputLocation)
displayName: 'Build Support Tools'
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
- task: BatchScript@1
displayName: 'Enforce clang-format'
timeoutInMinutes: 60
inputs:
filename: 'azure-devops/enforce-clang-format.cmd'
failOnStandardError: true
arguments: '$(buildOutputLocation)/parallelize/parallelize.exe'
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
- task: BatchScript@1
displayName: 'Validate Files'
timeoutInMinutes: 2
inputs:
filename: 'azure-devops/validate-files.cmd'
failOnStandardError: true
arguments: '$(buildOutputLocation)/validate/validate.exe'
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
- publish: '$(buildOutputLocation)/parallelize/parallelize.exe'
sylveon marked this conversation as resolved.
Show resolved Hide resolved
artifact: parallelize
- publish: '$(buildOutputLocation)/validate/validate.exe'
artifact: validate
- template: azure-devops/run-tool.yml
parameters:
name: Enforce_Clang_Format
displayName: 'Enforce clang-format'
timeout: 60
toolName: parallelize
script: azure-devops/enforce-clang-format.cmd
- template: azure-devops/run-tool.yml
parameters:
name: Validate_Files
displayName: 'Validate Files'
timeout: 2
toolName: validate
script: azure-devops/validate-files.cmd
- stage: Build_And_Test
displayName: 'Build and Test'
jobs:
Expand Down