forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.azure-pipelines.yml
216 lines (203 loc) · 6.65 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
name: $(Build.SourceBranch)-$(date:yyyyMMdd)$(rev:.r)
trigger:
branches:
include:
- 'master'
tags:
include:
- '*'
exclude:
- 'dev'
jobs:
- job: rustfmt
pool:
vmImage: 'macos-10.14'
steps:
- checkout: self
submodules: true
- template: ci/azure-install-rust.yml
- script: rustup component add rustfmt
displayName: Add rustfmt
- script: cargo fmt --all -- --check
displayName: Check formatting
variables:
toolchain: stable
# Smoke test to build docs on one builder, using OSX for now since it's the
# fastest
- job: docs
pool:
vmImage: 'macos-10.14'
steps:
- checkout: self
submodules: true
- template: ci/azure-install-rust.yml
- script: cargo doc
displayName: Build documentation
variables:
toolchain: stable
- job: Test
strategy:
matrix:
windows-stable:
imageName: 'vs2017-win2016'
toolchain: stable
linux-stable:
imageName: 'ubuntu-16.04'
toolchain: stable
mac-stable:
imageName: 'macos-10.14'
toolchain: stable
mac-beta:
imageName: 'macos-10.14'
toolchain: beta
mac-nightly:
imageName: 'macos-10.14'
toolchain: nightly
pool:
vmImage: $(imageName)
steps:
- checkout: self
submodules: true
- template: ci/azure-install-rust.yml
- script: cargo fetch
displayName: Fetch cargo dependencies
# Build and test all features except for lightbeam
- bash: cargo test --all --exclude lightbeam --exclude wasmtime-wasi-c --exclude wasmtime-py
displayName: Cargo test
env:
RUST_BACKTRACE: 1
# Build and test lightbeam if we're using the nightly toolchain
- bash: cargo build --package lightbeam
displayName: Cargo build lightbeam
condition: and(succeeded(), eq(variables['toolchain'], 'nightly'))
- bash: cargo test --package lightbeam
displayName: Cargo test lightbeam
# Lightbeam tests fail right now, but we don't want to block on that.
continueOnError: true
condition: and(succeeded(), eq(variables['toolchain'], 'nightly'))
env:
RUST_BACKTRACE: 1
- job: Build
strategy:
matrix:
windows:
imageName: 'vs2017-win2016'
# Statically link against msvcrt to produce slightly more portable
# binaries on Windows by reducing our binary compatibility requirements.
RUSTFLAGS: -Ctarget-feature=+crt-static
mac:
imageName: 'macos-10.14'
# Lower the deployment target from our build image in an attempt to
# build more portable binaries that run on older releases. Note that
# 10.9 here is arbitrarily chosen and just happens to be the lowest that
# works at this time. Raising this is probably fine.
MACOSX_DEPLOYMENT_TARGET: 10.9
variables:
toolchain: stable
pool:
vmImage: $(imageName)
steps:
- template: ci/azure-build-release.yml
# Build the Linux release binary in an older Linux container (in this case
# Centos 6)
- job: Build_linux
variables:
toolchain: stable
container:
image: centos:6
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
steps:
- template: ci/azure-prepare-centos-6.yml
- template: ci/azure-build-release.yml
# Build the `wasmtime-py` python extension in the same manner we build the
# binaries above, since these wheels are also native code that we're
# distributing.
#
# Note that the builds here are using a nightly compiler, not a stable compiler,
# since this is what PyO3 requires.
- job: Build_wheels
strategy:
matrix:
windows:
imageName: 'vs2017-win2016'
RUSTFLAGS: -Ctarget-feature=+crt-static
mac:
imageName: 'macos-10.14'
MACOSX_DEPLOYMENT_TARGET: 10.9
variables:
toolchain: nightly-2019-08-15
pool:
vmImage: $(imageName)
steps:
- template: ci/azure-build-wheels.yml
- job: Build_linux_wheels
variables:
toolchain: nightly-2019-08-15
container:
image: centos:6
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
steps:
- template: ci/azure-prepare-centos-6.yml
- template: ci/azure-build-wheels.yml
- job: Publish
dependsOn:
- Build
- Build_wheels
- Build_linux
- Build_linux_wheels
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
steps:
# Checking out the sources is needed to be able to delete the "dev" tag, see below.
- checkout: self
persistCredentials: true
submodules: false
- task: DownloadPipelineArtifact@1
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
- script: |
echo "##vso[task.setvariable variable=tagName;]`echo $BUILD_SOURCEBRANCH | sed -e 's|refs/tags/||'`"
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
- task: GitHubRelease@0
inputs:
gitHubConnection: 'tschneidereit-releases'
target: '$(Build.SourceVersion)'
tagSource: 'manual'
tag: '$(tagName)'
title: 'Wasmtime $(tagName)'
assets: '$(Build.ArtifactStagingDirectory)/**'
isDraft: false
isPreRelease: true
condition: and(startsWith(variables['Build.SourceBranch'], 'refs/tags/'),
ne(variables['Build.SourceBranch'], 'refs/tags/dev'))
# GitHub doesn't support doing rolling releases for branch.
# To simulate that for dev builds, always do a release for the "dev" tag.
# While the `edit` action for the GitHubRelease task would replace any assets
# associated with the tag, it wouldn't update the tag itself. Hence, delete the
# tag if it exists, and re-create it every time.
# Also explicitly delete the GitHub release, which would otherwise turn into a draft
# and linger forever.
- task: GitHubRelease@0
inputs:
gitHubConnection: 'tschneidereit-releases'
action: 'delete'
tag: 'dev'
# This might fail in case the target repo doesn't yet have this tag, which is fine.
continueOnError: true
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/tags/dev')
- script: |
git -c http.extraheader="AUTHORIZATION: basic ***" push origin :dev
# This might fail in case the target repo doesn't yet have this tag, which is fine.
continueOnError: true
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/tags/dev')
- task: GitHubRelease@0
inputs:
gitHubConnection: 'tschneidereit-releases'
action: 'create'
target: '$(Build.SourceVersion)'
tag: 'dev'
tagSource: 'manual'
title: 'Latest CI build'
assets: '$(Build.ArtifactStagingDirectory)/**'
isDraft: false
isPreRelease: true
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/tags/dev')