forked from rust-skia/rust-skia
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines-template.yml
208 lines (185 loc) · 6.78 KB
/
azure-pipelines-template.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
parameters:
# defaults:
androidHost: ''
androidNDK: ''
jobs:
- job: "${{ parameters.platform }}"
timeoutInMinutes: 0
strategy:
matrix:
${{ if eq(parameters.deployRelease, 'True') }}:
stable:
toolchain: stable
features: ''
exampleArgs: ''
stable-gl:
toolchain: stable
features: 'gl'
exampleArgs: ''
stable-vulkan:
toolchain: stable
features: 'vulkan'
exampleArgs: ''
stable-textlayout:
toolchain: stable
features: 'textlayout'
exampleArgs: ''
stable-gl-textlayout:
toolchain: stable
features: 'gl,textlayout'
exampleArgs: ''
stable-vulkan-textlayout:
toolchain: stable
features: 'vulkan,textlayout'
exampleArgs: ''
stable-all-features:
toolchain: stable
features: 'gl,vulkan,textlayout'
exampleArgs: ''
${{ if eq(parameters.deployRelease, 'False') }}:
stable-all-features:
toolchain: stable
features: 'gl,vulkan,textlayout'
exampleArgs: '--driver cpu --driver pdf --driver svg'
stable-all-features-debug:
toolchain: stable
features: 'gl,vulkan,textlayout'
exampleArgs: ''
skia_debug: '1'
beta-all-features:
toolchain: beta
features: 'gl,vulkan,textlayout'
exampleArgs: ''
variables:
platform: ${{ parameters.platform }}
platformTarget: ${{ parameters.platformTarget }}
image: ${{ parameters.image }}
androidHost: ${{ parameters.androidHost }}
androidNDK: ${{ parameters.androidNDK }}
androidAPILevel: ${{ parameters.androidAPILevel }}
androidBinExt: ${{ parameters.androidBinExt }}
rust_backtrace: 1
pool:
vmImage: $(image)
steps:
- ${{ if eq(parameters.platform, 'macOS') }}:
# macOS
- bash: |
echo "##vso[task.setvariable variable=PATH;]/usr/local/opt/llvm/bin:$PATH"
displayName: Set path to clang / llvm-config
- ${{ if eq(parameters.platform, 'Windows') }}:
# Windows.
- task: UsePythonVersion@0
inputs:
versionSpec: '2.x'
addToPath: true
architecture: 'x64'
- bash: |
set -e
choco install llvm --version 9.0.0
displayName: Install LLVM on Windows
# All platforms (Linux images have Rust preinstalled and in the PATH).
- bash: |
set -e
rustup default ${TOOLCHAIN}
rustup update ${TOOLCHAIN}
rustup component add clippy --toolchain ${TOOLCHAIN}
rustup component add rustfmt --toolchain ${TOOLCHAIN}
rustc -Vv
cargo -V
displayName: Update Rust, Install Clippy and Rustfmt and print Rust & Cargo Versions
- ${{ if eq(parameters.platform, 'Linux') }}:
# Linux Ubuntu 18.04 (Gl/glx.h and libgl)
- bash: |
set -e
sudo apt-get update
sudo apt-get install mesa-common-dev libgl1-mesa-dev libgl1
displayName: Install mesa-common-dev libgl1-mesa-dev and libgl1
- ${{ if ne(parameters.platform, 'Windows') }}:
# Linux and macOS.
- script: |
clang --version
displayName: LLVM/Clang Version
- ${{ if eq(parameters.platform, 'Windows') }}:
# Windows.
- script: |
"C:/Program Files/LLVM/bin/clang.exe" --version
displayName: LLVM/Clang Version
- ${{ if ne(parameters.androidHost, '') }}:
# Android NDK
- bash: |
set -e
(cd ${HOME} && curl -sSf -o android-ndk.zip https://dl.google.com/android/repository/android-ndk-$(androidNDK)-$(androidHost).zip)
(cd ${HOME} && unzip android-ndk.zip)
echo "##vso[task.setvariable variable=ANDROID_NDK;]${HOME}/android-ndk-$(androidNDK)"
echo "##vso[task.setvariable variable=PATH;]${PATH}:${HOME}/android-ndk-$(androidNDK)/toolchains/llvm/prebuilt/$(androidHost)/bin"
displayName: 'Install Android NDK $(androidNDK)'
# Note: support to ignore specific rust files and directories is unstable yet: https://github.com/rust-lang/rustfmt/pull/2522
- bash: |
set -e
echo "// WAITING FOR RUSTFMT.TOML TO SUPPORT IGNORING FILES" >skia-bindings/src/bindings.rs
cargo fmt -- --check
rm skia-bindings/src/bindings.rs
displayName: Check Rust formatting
- template: 'azure-pipelines-build-target.yml'
parameters:
target: '$(platformTarget)'
exampleArgs: '$(exampleArgs)'
runClippy: true
runBinaries: true
releaseBinaries: ${{ parameters.deployRelease }}
${{ if and(eq(parameters.platform, 'macOS'), eq(parameters.deployRelease, 'False')) }}:
features: '$(features),metal'
- ${{ if eq(parameters.platform, 'macOS') }}:
- template: 'azure-pipelines-build-target.yml'
parameters:
target: 'aarch64-linux-android'
androidEnv: true
releaseBinaries: ${{ parameters.deployRelease }}
- template: 'azure-pipelines-build-target.yml'
parameters:
target: 'x86_64-linux-android'
androidEnv: true
releaseBinaries: ${{ parameters.deployRelease }}
- template: 'azure-pipelines-build-target.yml'
parameters:
target: 'i686-linux-android'
androidEnv: true
- template: 'azure-pipelines-build-target.yml'
parameters:
target: 'aarch64-apple-ios'
releaseBinaries: ${{ parameters.deployRelease }}
${{ if and(eq(parameters.platform, 'macOS'), eq(parameters.deployRelease, 'False')) }}:
features: '$(features),metal'
- template: 'azure-pipelines-build-target.yml'
parameters:
target: 'x86_64-apple-ios'
releaseBinaries: ${{ parameters.deployRelease }}
${{ if and(eq(parameters.platform, 'macOS'), eq(parameters.deployRelease, 'False')) }}:
features: '$(features),metal'
- ${{ if eq(parameters.platform, 'Linux') }}:
- template: 'azure-pipelines-build-target.yml'
parameters:
target: 'aarch64-linux-android'
androidEnv: true
- template: 'azure-pipelines-build-target.yml'
parameters:
target: 'x86_64-linux-android'
androidEnv: true
- template: 'azure-pipelines-build-target.yml'
parameters:
target: 'i686-linux-android'
androidEnv: true
# TODO: Windows Android builds are temporarily disabled, because of:
# error occurred:
# Failed to find tool. Is `aarch64-linux-android26-clang.cmd` installed?
# >> works locally on msys2, probably a PATH problem with AZURE?, although PATH variable looks fine.
# - ${{ if eq(parameters.platform, 'Windows') }}:
# - template: 'azure-pipelines-build-target.yml'
# parameters:
# target: 'aarch64-linux-android'
# androidEnv: true
# - template: 'azure-pipelines-build-target.yml'
# parameters:
# target: 'x86_64-linux-android'
# androidEnv: true