-
Notifications
You must be signed in to change notification settings - Fork 43
/
azure-pipelines.yml
262 lines (252 loc) · 9 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
#
# Author: github.com/luncliff ([email protected])
#
# References
# https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates
# https://github.com/actions/virtual-environments/tree/main/images
# https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/
#
trigger:
branches:
exclude:
- docs
- gh-pages
schedules:
- cron: "30 6 * * 4"
displayName: "Weekly check"
branches:
include:
- main
variables:
- name: vcpkg.commit
value: "e809a42f87565e803b2178a0c11263f462d1800a" # mainstream 2022.04.12
jobs:
- job: vs2022_msvc
pool:
vmImage: "windows-2022"
variables:
configuration: Debug
cmake.preset: x64-msvc-debug
vcpkg.target.triplet: x64-windows
steps:
- task: run-vcpkg@0
inputs:
vcpkgArguments: "catch2 ms-gsl spdlog"
vcpkgGitCommitId: $(vcpkg.commit)
env:
VCPKG_DEFAULT_TRIPLET: $(vcpkg.target.triplet)
- task: CMake@1
displayName: "CMake: Configure"
inputs:
cmakeArgs: --preset $(cmake.preset) -DCMAKE_INSTALL_PREFIX:PATH="$(Build.ArtifactStagingDirectory)"
workingDirectory: "."
- task: MSBuild@1
inputs:
solution: "build-x64-windows/coroutine.sln"
msbuildArchitecture: x64
platform: x64
configuration: $(configuration)
msbuildArguments: "/p:platformtoolset=v142"
- task: CMake@1
displayName: "CMake: Build"
inputs:
cmakeArgs: --build --preset $(cmake.preset)
workingDirectory: "."
# - powershell: ctest --preset $(cmake.preset) --output-on-failure
# displayName: "CTest"
- job: vs2022_clangcl
pool:
vmImage: "windows-2022"
strategy:
matrix:
debug_x86:
vcvars.arg: x86
cmake.preset: x86-clang-debug
vcpkg.target.triplet: x86-windows
debug_x64:
vcvars.arg: x64
cmake.preset: x64-clang-debug
vcpkg.target.triplet: x64-windows
steps:
- task: ChocolateyCommand@0
inputs:
command: "install"
installPackageId: "ninja"
installInstallArgs: "--no-progress --yes"
- task: run-vcpkg@0
inputs:
vcpkgArguments: "catch2 ms-gsl spdlog"
vcpkgGitCommitId: $(vcpkg.commit)
env:
VCPKG_DEFAULT_TRIPLET: $(vcpkg.target.triplet)
# see https://www.cicoria.com/using-vcvars64-vcvars-bat-from-powershell-and-azure-devops/
- powershell: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$installPath = &$vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
echo "##vso[task.setvariable variable=vcvarsPath;isOutput=true]$installPath\VC\Auxiliary\Build\vcvarsall.bat"
name: detected
displayName: "PowerShell: Search vcvarsall.bat"
- script: | # using Cmdlet
echo $(detected.vcvarsPath)
call "$(detected.vcvarsPath)" $(vcvars.arg)
clang -dM test/a.cpp -E -std=c++20
displayName: "Clang: Print Macros"
# see https://github.com/Microsoft/azure-pipelines-tasks/issues/9737
- script: | # using Cmdlet
call "$(detected.vcvarsPath)" $(vcvars.arg)
cmake --preset $(cmake.preset) -DCMAKE_INSTALL_PREFIX:PATH="$(Build.ArtifactStagingDirectory)"
displayName: "CMake: Configure/Generate(vcvarsall)"
- task: MSBuild@1
inputs:
solution: "build-$(vcpkg.target.triplet)/coroutine.sln"
- job: macos11_appleclang
pool:
vmImage: "macos-11"
strategy: # todo: strategy for x86_64, arm64
matrix:
debug_x64:
vcpkg.target.triplet: x64-osx
cmake.preset: x64-osx-debug
debug_arm64:
vcpkg.target.triplet: arm64-osx
cmake.preset: arm64-osx-debug
steps:
- powershell: brew install ninja
displayName: "Setup: Homebrew packages"
- task: run-vcpkg@0
inputs:
vcpkgArguments: "catch2 ms-gsl spdlog"
vcpkgGitCommitId: $(vcpkg.commit)
env:
VCPKG_DEFAULT_TRIPLET: $(vcpkg.target.triplet)
- task: CMake@1
displayName: "CMake: Configure"
inputs:
cmakeArgs: --preset $(cmake.preset) -DCMAKE_INSTALL_PREFIX:PATH="$(Build.ArtifactStagingDirectory)"
workingDirectory: "."
- task: CMake@1
displayName: "CMake: Build"
inputs:
cmakeArgs: --build --preset $(cmake.preset)
workingDirectory: "."
# - powershell: ctest --preset $(cmake.preset) --output-on-failure
# displayName: "CTest"
- job: ubuntu20_gcc
pool:
vmImage: "ubuntu-20.04"
variables:
cmake.preset: x64-linux-debug
vcpkg.target.triplet: x64-linux
cc: gcc-10
cxx: g++-10
steps:
- powershell: sudo apt-get install -y gcc-10 g++-10 ninja-build
displayName: "Install APT packages"
- task: run-vcpkg@0
inputs:
vcpkgArguments: "catch2 ms-gsl spdlog"
vcpkgGitCommitId: $(vcpkg.commit)
env:
VCPKG_DEFAULT_TRIPLET: $(vcpkg.target.triplet)
- task: CMake@1
displayName: "CMake: Configure"
inputs:
cmakeArgs: --preset $(cmake.preset) -DCMAKE_INSTALL_PREFIX:PATH="$(Build.ArtifactStagingDirectory)"
workingDirectory: "."
- job: ubuntu22_clang
pool:
vmImage: "ubuntu-22.04"
variables:
cmake.preset: x64-linux-debug
vcpkg.target.triplet: x64-linux
cc: clang-14
cxx: clang++-14
steps:
- powershell: sudo apt-get install -y llvm-14-dev clang-14 libc++-14-dev libc++abi-14-dev libunwind-14-dev ninja-build
displayName: "Install APT packages"
- task: run-vcpkg@0
inputs:
vcpkgArguments: "catch2 ms-gsl spdlog"
vcpkgGitCommitId: $(vcpkg.commit)
env:
VCPKG_DEFAULT_TRIPLET: $(vcpkg.target.triplet)
- task: CMake@1
displayName: "CMake: Configure"
inputs:
cmakeArgs: --preset $(cmake.preset) -DCMAKE_INSTALL_PREFIX:PATH="$(Build.ArtifactStagingDirectory)"
workingDirectory: "."
- job: android_clang12
pool:
vmImage: "ubuntu-22.04"
strategy:
matrix:
debug_arm64:
cmake.preset: arm64-android-debug
build.triplet: arm64-android
debug_x64:
cmake.preset: x64-android-debug
build.triplet: x64-android
variables:
ANDROID_NDK_HOME: "/usr/local/lib/android/sdk/ndk/23.2.8568313" # check $ANDROID_NDK_LATEST_HOME
steps:
- checkout: self
- powershell: sudo apt-get install -y --fix-missing ninja-build tree curl zip unzip tar rsync
displayName: "Install: APT packages"
# - powershell: New-Item -Type Directory -Force ${env:VCPKG_DEFAULT_BINARY_CACHE}
# - task: Cache@2
# inputs:
# key: '2022-06 | vcpkg-android | $(build.triplet)'
# path: $(vcpkg.default.binary.cache)
# displayName: "Cache: Vcpkg"
- task: run-vcpkg@0
inputs:
vcpkgArguments: "ms-gsl spdlog"
vcpkgGitCommitId: $(vcpkg.commit)
env:
VCPKG_DEFAULT_TRIPLET: $(build.triplet)
- task: CMake@1
displayName: "CMake: Configure/Generate"
inputs:
cmakeArgs: "--preset=$(cmake.preset)"
workingDirectory: $(Build.SourcesDirectory)
- task: CMake@1
displayName: "CMake: Build"
inputs:
cmakeArgs: "--build --preset=$(cmake.preset)"
workingDirectory: $(Build.SourcesDirectory)
- job: mkdocs
pool:
vmImage: "macos-10.15"
steps:
- powershell: |
brew install doxygen
python3 -m pip install --user -r requirements.txt
displayName: "Setup: Homebrew, Python3 packages"
- powershell: |
wget -q https://github.com/matusnovak/doxybook2/releases/download/v1.4.0/doxybook2-osx-amd64-v1.4.0.zip
unzip ./doxybook2-osx-amd64-v1.4.0.zip -d externals
displayName: "Setup: Doxybook2 1.4.0"
- powershell: |
doxygen ./docs/Doxyfile
./externals/bin/doxybook2 --input ./docs/xml --output ./docs
displayName: "Run Doxygen and Doxybook2"
- powershell: python3 -m mkdocs build # todo: gh-deploy
# - task: ArchiveFiles@2
# inputs:
# rootFolderOrFile: "$(Build.SourcesDirectory)/docs"
# includeRootFolder: false
# archiveType: "zip"
# archiveFile: "$(Build.ArtifactStagingDirectory)/docs.zip"
# replaceExistingArchive: true
- task: PublishBuildArtifacts@1
inputs:
# PathtoPublish: "$(Build.ArtifactStagingDirectory)"
PathtoPublish: "$(Build.SourcesDirectory)/docs"
ArtifactName: "docs"
dependsOn:
- vs2022_msvc
- vs2022_clangcl
- macos11_appleclang
- ubuntu20_gcc
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))