-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
102 lines (98 loc) · 3.44 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
91
92
93
94
95
96
97
98
99
100
101
jobs:
- job: BuildTestAndPublish
displayName: "Build, test and publish C++ applications"
pool:
name: Default
demands:
- msbuild
- visualstudio
- vstest
variables:
ArtifactProjectName: 'Brainfreeze'
CMakeProjectName: 'Brainfreeze'
strategy:
maxParallel: 4
matrix:
debug_x86:
BuildConfiguration: 'Debug'
BuildPlatform: 'x86'
PlatformTarget: 'x86'
CMakeBuildType: 'Debug'
debug_x64:
BuildConfiguration: 'Debug'
BuildPlatform: 'x64'
PlatformTarget: 'x64'
CMakeBuildType: 'Debug'
release_x86:
BuildConfiguration: 'Release'
BuildPlatform: 'x86'
PlatformTarget: 'x86'
CMakeBuildType: 'RelWithDebInfo'
release_x64:
BuildConfiguration: 'Release'
BuildPlatform: 'x64'
PlatformTarget: 'x64'
CMakeBuildType: 'RelWithDebInfo'
steps:
- task: BatchScript@1
displayName: 'Configure Visual Studio build tools environment'
inputs:
filename: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat'
arguments: '$(PlatformTarget)'
failOnStandardError: true
modifyEnvironment: true
- task: CMake@1
displayName: 'Configure CMake'
inputs:
workingDirectory: 'build\$(PlatformTarget)-$(BuildConfiguration)'
cmakeArgs: '../../ -G "Ninja" -DCMAKE_BUILD_TYPE=$(CmakeBuildType)'
- task: CMake@1
displayName: 'Build using CMake'
inputs:
workingDirectory: 'build\$(PlatformTarget)-$(BuildConfiguration)'
cmakeArgs: '--build .'
- task: CmdLine@2
displayName: 'Run unit tests'
inputs:
script: |
pushd tests\unit\bf
.\tests.exe -r junit -o testresults.xml
popd
workingDirectory: 'build\$(PlatformTarget)-$(BuildConfiguration)'
failOnStderr: true
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'build\$(PlatformTarget)-$(BuildConfiguration)/tests/**/*.xml'
failTaskOnFailedTests: true
testRunTitle: 'Unit tests ($(PlatformTarget) ($BuildConfiguration))'
platform: '$(PlatformTarget)'
configuration: '$(BuildConfiguration)'
- task: CmdLine@2
displayName: 'Run CPack'
inputs:
script: |
"C:\Program Files\CMake\bin\cpack.exe" ../../
workingDirectory: 'build\$(PlatformTarget)-$(BuildConfiguration)'
failOnStderr: false
- task: CopyFiles@2
displayName: 'Copy CPack installers to build staging'
inputs:
SourceFolder: 'build\$(PlatformTarget)-$(BuildConfiguration)'
Contents: |
$(CMakeProjectName)-*.exe
$(CMakeProjectName)-*.msi
$(CMakeProjectName)-*.zip
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishSymbols@2
displayName: 'Publish symbols'
inputs:
SearchPattern: 'build\$(PlatformTarget)-$(BuildConfiguration)\src\**\*.pdb'
SymbolServerType: TeamServices
SymbolsArtifactName: 'Symbols_$(PlatformTarget)_$(BuildConfiguration)'
continueOnError: true
- task: PublishBuildArtifacts@1
displayName: 'Publish build artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: '$(ArtifactProjectName)-$(BuildConfiguration)-$(PlatformTarget)'