-
Notifications
You must be signed in to change notification settings - Fork 274
Expand file tree
/
Copy pathOneBranchTest.yml
More file actions
127 lines (115 loc) · 3.94 KB
/
OneBranchTest.yml
File metadata and controls
127 lines (115 loc) · 3.94 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
parameters:
- name: BuildConfiguration
type: string
- name: BuildVersion
type: string
jobs:
- job:
pool:
type: windows
isCustom: true
name: 'Azure Pipelines'
vmImage: 'windows-2022' # (or 2019)
strategy:
matrix:
test.x86:
TestExe: 'test'
TestProject: 'test'
BuildPlatform: 'x86'
test_nocoro.x86:
TestExe: 'test_nocoro'
TestProject: 'test_nocoro'
BuildPlatform: 'x86'
test_cppmodules.x86:
TestExe: 'test_cppmodules'
TestProject: 'test_cppmodules'
BuildPlatform: 'x86'
test_cpp20.x86:
TestExe: 'test_cpp20'
TestProject: 'test_cpp20'
BuildPlatform: 'x86'
test_cpp20_no_sourcelocation.x86:
TestExe: 'test_cpp20_no_sourcelocation'
TestProject: 'test_cpp20_no_sourcelocation'
BuildPlatform: 'x86'
test_fast.x86:
TestExe: 'test_fast'
TestProject: 'test_fast'
BuildPlatform: 'x86'
test_slow.x86:
TestExe: 'test_slow'
TestProject: 'test_slow'
BuildPlatform: 'x86'
test_old.x86:
TestExe: 'test_old'
TestProject: 'old_tests\test_old'
BuildPlatform: 'x86'
test_module_lock_custom.x86:
TestExe: 'test_module_lock_custom'
TestProject: 'test_module_lock_custom'
BuildPlatform: 'x86'
test_module_lock_none.x86:
TestExe: 'test_module_lock_none'
TestProject: 'test_module_lock_none'
BuildPlatform: 'x86'
variables:
ob_outputDirectory: $(Build.SourcesDirectory)\out
ob_artifactSuffix: $(TestExe).$(BuildPlatform)
ob_sdl_codeSignValidation_excludes: '-|**\*.exe;-|**\*.dll'
ob_sdl_prefast_enabled: true
ob_sdl_prefast_runDuring: 'Build'
ob_sdl_checkCompliantCompilerWarnings: true
BuildPath: '$(Build.SourcesDirectory)/_build/$(BuildPlatform)/${{ parameters.BuildConfiguration }}'
steps:
- task: UseDotNet@2
continueOnError: true
inputs:
packageType: 'runtime'
version: '6.x'
performMultiLevelLookup: true
- task: DownloadPipelineArtifact@2
displayName: 'Download cppwinrt executable'
inputs:
artifactName: 'drop_build_$(BuildPlatform)'
targetPath: '$(Pipeline.Workspace)'
- task: CopyFiles@2
displayName: 'Patch cppwinrt executable into build directory'
inputs:
sourceFolder: '$(Pipeline.Workspace)'
Contents: '**\cppwinrt.exe'
TargetFolder: $(BuildPath)
flattenFolders: true
- task: NuGetCommand@2
displayName: NuGet restore cppwinrt.sln
inputs:
command: 'restore'
restoreSolution: '$(Build.SourcesDirectory)\cppwinrt.sln'
feedsToUse: config
nugetConfigPath: NuGet.config
- task: PowerShell@2
displayName: Remove cppwinrt dependency from test projects
inputs:
targetType: inline
script: |
# Hack-ish: We already have a built exe, so we want to avoid rebuilding cppwinrt
mv cppwinrt.sln cppwinrt.sln.orig
Get-Content cppwinrt.sln.orig |
Where-Object { -not $_.Contains("{D613FB39-5035-4043-91E2-BAB323908AF4} = {D613FB39-5035-4043-91E2-BAB323908AF4}") } |
Set-Content cppwinrt.sln
"Modified contents"
Get-Content cppwinrt.sln
- task: CmdLine@2
displayName: Run cppwinrt to build projection
inputs:
script: $(BuildPath)\cppwinrt.exe -in local -out $(BuildPath) -verbose
- task: VSBuild@1
displayName: Build test
inputs:
solution: $(Build.SourcesDirectory)\cppwinrt.sln
msbuildArgs: /t:test\$(TestProject) /m /p:CppWinRTBuildVersion=${{ parameters.BuildVersion }},clean_intermediate_files=true /bl:$(ob_outputDirectory)\output.binlog
platform: $(BuildPlatform)
configuration: ${{ parameters.BuildConfiguration }}
- task: CmdLine@2
displayName: Run test
inputs:
script: $(BuildPath)\$(TestExe).exe