-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathazure-pipelines.yml
91 lines (86 loc) · 2.67 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
trigger:
- main
pr:
- main
variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
CI: 1
stages:
# build and publish so we have artifacts even for builds that don't pass tests
# the main purpose of this is to share built version with others to test changes
# without setting up build environment
- stage: Build
displayName: "Build and Publish"
jobs:
- job:
workspace:
clean: all
pool:
vmImage: windows-2022
steps:
- task: PowerShell@2
displayName: 'Build Profiler'
inputs:
targetType: inline
pwsh: true
script: |
& ./build.ps1
workingDirectory: '$(Build.SourcesDirectory)'
- task: PowerShell@2
displayName: 'Get Short Hash'
inputs:
targetType: inline
pwsh: true
script: |
$shortHash = $env:BUILD_SOURCEVERSION.subString(0, 7)
Write-Host "##vso[task.setvariable variable=shortHash]$shortHash"
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/Profiler'
artifact: 'Profiler-$(Build.SourceBranchName)-$(shortHash)'
publishLocation: 'pipeline'
- stage: Test
jobs:
- job:
workspace:
clean: all
strategy:
matrix:
PS7_Windows:
vmImage: windows-2022
pwsh: true
PS_5_1_Windows:
vmImage: windows-2022
pwsh: false
PS7_Ubuntu:
vmImage: ubuntu-20.04
pwsh: true
PS7_macOS:
vmImage: macOS-11
pwsh: true
pool:
vmImage: $[ variables['vmImage'] ]
steps:
- task: PowerShell@2
displayName: 'Test Profiler'
inputs:
targetType: inline
pwsh: $(pwsh)
script: |
& ./test.ps1 -Clean
workingDirectory: '$(Build.SourcesDirectory)'
# - task: PublishCodeCoverageResults@1
# inputs:
# codeCoverageTool: 'JaCoCo'
# summaryFileLocation: 'coverage.xml'
# pathToSources: 'src/'
# failIfCoverageEmpty: false
# condition: succeededOrFailed()
# - task: PublishTestResults@2
# inputs:
# testResultsFormat: 'NUnit'
# testResultsFiles: 'testResults.xml'
# failTaskOnFailedTests: true
# condition: succeededOrFailed()
timeoutInMinutes: 20