-
Notifications
You must be signed in to change notification settings - Fork 284
/
azure-pipelines.yml
71 lines (71 loc) · 2.42 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
trigger:
branches:
include:
- '*'
tags:
include:
- '*'
pr:
branches:
exclude:
- '*'
resources:
- repo: self
variables:
tag: '$(Build.BuildId)'
vmImage: 'ubuntu-latest'
stages:
- stage: Build
displayName: Build
jobs:
- job: Build
timeoutInMinutes: 120
displayName: Build
pool:
vmImage: $(vmImageName)
name: Test-Rafael
steps:
- pwsh: .\build.ps1
name: build_images
displayName: 'Build images'
env:
REGISTRY_USER: $(REGISTRY_USER)
REGISTRY_PWD: $(REGISTRY_PWD)
REGISTRY_PATH: $(REGISTRY_PATH)
IMAGE_VERSION: $(Build.SourceBranchName)
- pwsh: .\build.ps1 -RunTests
name: run_tests
displayName: 'Run tests'
env:
REGISTRY_USER: $(REGISTRY_USER)
REGISTRY_PWD: $(REGISTRY_PWD)
REGISTRY_PATH: $(REGISTRY_PATH)
IMAGE_VERSION: $(Build.SourceBranchName)
TESTDIR: '$(System.DefaultWorkingDirectory)/Tests'
- task: PublishTestResults@2
name: publish_tests_results
displayName: 'Publish Test Results'
condition: and(not(canceled()), not(contains(variables['Build.SourceVersionMessage'], '[notest]')))
inputs:
testResultsFormat: 'JUnit' # 'JUnit' | 'NUnit' | 'VSTest' | 'XUnit' | 'CTest'. Alias: testRunner. Required. Test result format. Default: JUnit.
testResultsFiles: '**/*.xml' # string. Required. Test results files. Default: **/TEST-*.xml.
searchFolder: '$(System.DefaultWorkingDirectory)/Tests' # string. Search folder. Default: $(System.DefaultWorkingDirectory).
# mergeTestResults: true
failTaskOnFailedTests: true
failTaskOnFailureToPublishResults: true
failTaskOnMissingResultsFile: true
testRunTitle: Pester
# Advanced
#buildPlatform: # string. Alias: platform. Build Platform.
#buildConfiguration: # string. Alias: configuration. Build Configuration.
publishRunAttachments: true
- pwsh: .\build.ps1 -Push
name: push_containers
displayName: 'Push images'
# Only push if this is a tag, and the tests passed
condition: or(and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')), contains(variables['Build.SourceVersionMessage'], '[push]'))
env:
REGISTRY_USER: $(REGISTRY_USER)
REGISTRY_PWD: $(REGISTRY_PWD)
REGISTRY_PATH: $(REGISTRY_PATH)
IMAGE_VERSION: $(Build.SourceBranchName)