forked from wasmerio/wasmer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
287 lines (277 loc) · 9.97 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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
name: $(Build.SourceBranch)-$(date:yyyyMMdd)$(rev:.r)
# The Different jobs (lint, test, build to run)
jobs:
- job: changelog
steps:
- bash: |
git --no-pager diff --name-only HEAD $(git merge-base HEAD master) --exit-code CHANGELOG.md
displayName: Changelog Updated
- job: lint
pool:
vmImage: "macos-10.14"
steps:
- checkout: self
submodules: true
- template: .azure/install-rust.yml
- script: |
rustup component add rustfmt
rustup component add clippy || cargo install --git https://github.com/rust-lang/rust-clippy/ --force clippy
displayName: Lint dependencies
- script: cargo fmt --all -- --check
displayName: Lint
variables:
rust_toolchain: '1.39.0'
- job: Test
strategy:
matrix:
linux:
imageName: "ubuntu-16.04"
rust_toolchain: nightly-2019-12-19
mac:
imageName: "macos-10.14"
rust_toolchain: nightly-2019-12-19
# By default schannel checks revocation of certificates unlike some other SSL
# backends, but we've historically had problems on CI where a revocation
# server goes down presumably. See #43333 for more info
CARGO_HTTP_CHECK_REVOKE: false
windows:
imageName: "vs2017-win2016"
rust_toolchain: '1.39.0'
pool:
vmImage: $(imageName)
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying')
steps:
- checkout: self
submodules: true
- template: .azure/install-rust.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- bash: |
hostname
uname -a
displayName: System info (*nix)
condition: and(succeeded(), not(eq(variables['Agent.OS'], 'Windows_NT')))
- bash: |
cat /proc/cpuinfo
cat /proc/meminfo
displayName: System info - Extended (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- bash: |
sysctl -a | grep machdep.cpu
displayName: System info - Extended (Mac)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
- bash: make test
displayName: Tests (*nix)
condition: and(succeeded(), not(eq(variables['Agent.OS'], 'Windows_NT')))
- bash: make spectests-cranelift
displayName: Tests (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- job: Check
pool:
vmImage: "ubuntu-16.04"
variables:
rust_toolchain: nightly-2019-12-19
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying')
steps:
- checkout: self
submodules: true
- template: .azure/install-rust.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- bash: make check
displayName: Check with Flags
condition: and(succeeded(), not(eq(variables['Agent.OS'], 'Windows_NT')))
- job: Build_CLI
strategy:
matrix:
linux:
imageName: "ubuntu-16.04"
rust_toolchain: nightly-2019-12-19
mac:
imageName: "macos-10.14"
rust_toolchain: nightly-2019-12-19
MACOSX_DEPLOYMENT_TARGET: 10.10
windows:
imageName: "vs2017-win2016"
rust_toolchain: '1.39.0'
# RUSTFLAGS: -Ctarget-feature=+crt-static
pool:
vmImage: $(imageName)
condition: |
or(
in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying'),
startsWith(variables['Build.SourceBranch'], 'refs/tags')
)
steps:
- checkout: self
submodules: true
- template: .azure/install-rust.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- template: .azure/install-innosetup.yml
- bash: |
mkdir -p artifacts
displayName: Create Artifacts Dir
- bash: make release
displayName: Build (*nix)
condition: and(succeeded(), not(eq(variables['Agent.OS'], 'Windows_NT')))
- bash: make release-llvm
displayName: Build (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- bash: |
make wapm
displayName: Build WAPM
condition: |
startsWith(variables['Build.SourceBranch'], 'refs/tags')
- bash: |
make build-install
cp ./wasmer.tar.gz ./artifacts/$(./scripts/binary-name.sh)
displayName: Build Distribution (*nix)
condition: |
and(
succeeded(),
startsWith(variables['Build.SourceBranch'], 'refs/tags'),
not(eq(variables['Agent.OS'], 'Windows_NT'))
)
- bash: |
cd ./src/installer
iscc wasmer.iss
cp WasmerInstaller.exe ../../artifacts/wasmer-windows.exe
displayName: Build Distribution (Windows)
condition: |
and(
succeeded(),
startsWith(variables['Build.SourceBranch'], 'refs/tags'),
eq(variables['Agent.OS'], 'Windows_NT')
)
- publish: $(System.DefaultWorkingDirectory)/artifacts
artifact: cli-$(Agent.OS)
- job: Build_Library
strategy:
matrix:
linux:
imageName: "ubuntu-16.04"
rust_toolchain: nightly-2019-12-19
mac:
imageName: "macos-10.14"
rust_toolchain: nightly-2019-12-19
MACOSX_DEPLOYMENT_TARGET: 10.10
windows:
imageName: "vs2017-win2016"
rust_toolchain: '1.39.0'
# RUSTFLAGS: -Ctarget-feature=+crt-static
pool:
vmImage: $(imageName)
condition: |
or(
in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying'),
startsWith(variables['Build.SourceBranch'], 'refs/tags')
)
steps:
- checkout: self
submodules: true
- template: .azure/install-rust.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- bash: |
mkdir -p artifacts
displayName: Create Artifacts Dir
- bash: |
make test-capi
displayName: Test c-api
condition: and(succeeded(), not(eq(variables['Agent.OS'], 'Windows_NT')))
- bash: |
make capi
cp target/release/libwasmer_runtime_c_api.so ./artifacts
find target/release/build -name 'wasmer.h*' -exec cp {} ./artifacts ';'
displayName: Build c-api (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- bash: |
make capi
install_name_tool -id "@rpath/libwasmer_runtime_c_api.dylib" target/release/libwasmer_runtime_c_api.dylib
cp target/release/libwasmer_runtime_c_api.dylib ./artifacts
displayName: Build c-api (Darwin)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
- bash: |
make capi
cp target/release/wasmer_runtime_c_api.dll ./artifacts
displayName: Build c-api (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- publish: $(System.DefaultWorkingDirectory)/artifacts
artifact: library-$(Agent.OS)
- job: Publish
dependsOn:
- Build_CLI
- Build_Library
condition: |
startsWith(variables['Build.SourceBranch'], 'refs/tags')
steps:
# - download: current
- task: DownloadPipelineArtifact@1
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
- bash: |
ls $ARTIFACT_STAGING_DIRECTORY
displayName: List Artifacts
env:
ARTIFACT_STAGING_DIRECTORY: $(Build.ArtifactStagingDirectory)
- script: VERSION_TAG=`git describe --tags` && echo "##vso[task.setvariable variable=VERSION_TAG]$VERSION_TAG"
displayName: Set the tag name as an environment variable
- task: GithubRelease@0
displayName: "Create GitHub Release"
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
continueOnError: true
inputs:
gitHubConnection: 'wasmer'
repositoryName: 'wasmerio/wasmer'
action: 'create'
target: '$(Build.SourceVersion)'
title: '$(VERSION_TAG)'
addChangeLog: false
tagSource: 'auto'
# TODO: automate it all by getting the release notes from somewhere else and using the `releaseNotesFile` key
isDraft: false
isPreRelease: false
- task: GithubRelease@0
displayName: "Update GitHub Release with assets"
condition: and(succeededOrFailed(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
inputs:
gitHubConnection: 'wasmer'
repositoryName: 'wasmerio/wasmer'
action: 'edit'
target: '$(Build.SourceVersion)'
title: '$(VERSION_TAG)'
addChangeLog: false
tagSource: 'auto'
# TODO: automate it all by getting the release notes from somewhere else and using the `releaseNotesFile` key
isDraft: false
isPreRelease: false
assets: '$(Build.ArtifactStagingDirectory)/**'
- job: Docs
pool:
vmImage: "ubuntu-16.04"
variables:
rust_toolchain: nightly-2019-12-19
steps:
- checkout: self
submodules: true
- template: .azure/install-rust.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- bash: |
make docs
displayName: Build documentation
# We only run the pipelines on PRs to Master
pr:
- master
# Otherwise, we test in any of this branches (master or bors related)
trigger:
- master
- staging
- trying
- refs/tags/*