-
Notifications
You must be signed in to change notification settings - Fork 6
/
azure-pipelines.yml
202 lines (192 loc) · 7.33 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
#
# https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema
# https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables
# https://learn.microsoft.com/en-us/azure/devops/pipelines/scripts/cli/pipeline-variable-group-secret-nonsecret-variables
# https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/?view=azure-pipelines
# https://github.com/actions/runner-images/tree/main/images
#
trigger:
branches:
exclude:
- docs
- gh-pages
# pr:
# - main
schedules:
- cron: "10 4 * * 6"
displayName: "Weekly check"
branches:
include:
- main
variables:
# check https://github.com/microsoft/vcpkg/releases
- name: vcpkg.version
value: "2024.10.21"
- name: vcpkg.overlay.ports # VCPKG_OVERLAY_PORTS
value: $(Build.SourcesDirectory)/ports # --overlay-ports $(Build.SourcesDirectory)/ports
- name: vcpkg.overlay.triplets # VCPKG_OVERLAY_TRIPLETS
value: $(Build.SourcesDirectory)/triplets # --overlay-triplets $(Build.SourcesDirectory)/triplets
# check https://learn.microsoft.com/en-us/vcpkg/users/binarycaching
- group: Azure-Blob-Storage # az-*
- name: AzureSource
value: "x-azblob,https://$(az-storage).blob.core.windows.net/$(az-container),$(az-sas),readwrite"
- name: vcpkg.binary.sources # VCPKG_BINARY_SOURCES
value: "default" # $(AzureSource)
- name: vcpkg.default.binary.cache
value: $(Build.ArtifactStagingDirectory)/vcpkg-archives
stages:
- stage: "Windows"
dependsOn: []
jobs:
- job: "port_windows_arm"
displayName: "Windows(ARM)"
timeoutInMinutes: "200"
pool:
vmImage: windows-latest
variables:
- name: vcpkg.root
value: "C:/vcpkg" # VCPKG_INSTALLATION_ROOT
strategy:
matrix:
arm64_uwp:
vcpkg.default.triplet: "arm64-uwp"
steps:
- powershell: New-Item -Type Directory -Force "$env:VCPKG_DEFAULT_BINARY_CACHE"
- task: Cache@2
inputs:
key: '"v2445-bin-uwp" | "$(vcpkg.default.triplet)"'
restoreKeys: |
"v2445-bin-uwp" | "$(vcpkg.default.triplet)"
path: $(vcpkg.default.binary.cache)
- task: PowerShell@2
displayName: "Test: arm64-uwp"
inputs:
script: |
$Ports=$(Get-Content "test/azure-port-arm64-uwp.txt")
vcpkg install --keep-going $Ports --clean-buildtrees-after-build --clean-packages-after-build
targetType: 'inline'
condition: eq(variables['vcpkg.default.triplet'], 'arm64-uwp')
- task: CopyFiles@2
inputs:
SourceFolder: "$(vcpkg.root)/buildtrees/"
Contents: |
**/?(*.log|*.txt|*.cmake)
TargetFolder: "$(Build.ArtifactStagingDirectory)/log"
OverWrite: true
condition: always()
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: "$(Build.ArtifactStagingDirectory)/log"
ArtifactName: "$(Agent.JobName)"
condition: always()
- stage: "Ubuntu"
dependsOn: []
jobs:
- job: "port_linux"
displayName: "Linux"
timeoutInMinutes: "200"
pool:
vmImage: ubuntu-latest
variables:
- name: vcpkg.root
value: "/usr/local/share/vcpkg" # VCPKG_INSTALLATION_ROOT
strategy:
matrix:
x64_clang15:
vcpkg.default.triplet: "x64-linux"
cc: clang-15
cxx: clang++-15
x64_gcc11:
vcpkg.default.triplet: "x64-linux"
cc: gcc-11
cxx: g++-11
steps:
- powershell: sudo apt-get install -y $(Get-Content test/packages-apt.txt)
displayName: "Install APT packages"
- powershell: New-Item -Type Directory -Force "$env:VCPKG_DEFAULT_BINARY_CACHE"
- task: Cache@2
inputs:
key: '"v2445-bin-ubuntu" | "$(vcpkg.default.triplet)_$(cc)"'
restoreKeys: |
"v2445-bin-ubuntu" | "$(vcpkg.default.triplet)_$(cc)"
path: $(vcpkg.default.binary.cache)
- task: PowerShell@2
displayName: "Test: $(cxx)"
inputs:
script: |
$Ports=$(Get-Content "test/azure-port-linux.txt")
vcpkg install --keep-going $Ports --clean-buildtrees-after-build --clean-packages-after-build
targetType: 'inline'
- task: CopyFiles@2
inputs:
SourceFolder: "$(vcpkg.root)/buildtrees/"
Contents: |
**/?(*.log|*.txt|*.cmake)
TargetFolder: "$(Build.ArtifactStagingDirectory)/log"
OverWrite: true
condition: always()
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: "$(Build.ArtifactStagingDirectory)/log"
ArtifactName: "$(Agent.JobName)"
condition: always()
- stage: "Apple"
dependsOn: []
jobs:
- job: "port_ios"
displayName: "iOS"
timeoutInMinutes: "200"
pool:
vmImage: macos-latest
variables:
- name: vcpkg.root
value: "/usr/local/share/vcpkg" # VCPKG_INSTALLATION_ROOT
strategy:
matrix:
arm64_ios:
vcpkg.default.triplet: "arm64-ios"
vcpkg.overlay.triplets: "$(Build.SourcesDirectory)/triplets"
arm64_ios_simulator:
vcpkg.default.triplet: "arm64-ios-simulator"
vcpkg.overlay.triplets: "$(Build.SourcesDirectory)/triplets"
steps:
- script: brew install $(cat test/packages-homebrew.txt)
continueOnError: true
displayName: "Install HomeBrew packages"
- script: |
mkdir -p "$VCPKG_DEFAULT_BINARY_CACHE"
git clone --branch "$VCPKG_VERSION" --depth 1 https://github.com/microsoft/vcpkg
pushd vcpkg
./bootstrap-vcpkg.sh -disableMetrics
popd
workingDirectory: /usr/local/share/
displayName: "Setup vcpkg"
- task: Cache@2
inputs:
key: '"v2445-bin-ios" | "$(vcpkg.default.triplet)"'
restoreKeys: |
"v2445-bin-ios" | "$(vcpkg.default.triplet)"
path: $(vcpkg.default.binary.cache)
- task: PowerShell@2
displayName: "Test: $(vcpkg.default.triplet)"
inputs:
script: |
$env:PATH="/usr/local/share/vcpkg:$env:PATH"
$Ports=$(Get-Content "test/azure-port-ios.txt")
vcpkg install --keep-going $Ports --clean-buildtrees-after-build --clean-packages-after-build
targetType: 'inline'
- task: CopyFiles@2
inputs:
SourceFolder: "$(vcpkg.root)/buildtrees/"
Contents: |
**/?(*.log|*.txt|*.cmake)
TargetFolder: "$(Build.ArtifactStagingDirectory)/log"
OverWrite: true
condition: always()
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: "$(Build.ArtifactStagingDirectory)/log"
ArtifactName: "$(Agent.JobName)"
condition: always()
# todo: Deploy stage
# Status notification + GitHub release