This repository was archived by the owner on Dec 20, 2019. It is now read-only.
forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-pipelines.yml
232 lines (226 loc) · 7.42 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
variables:
LLVM_TARGETS_TO_BUILD: AArch64;ARM;Mips;MSP430;NVPTX;PowerPC;RISCV;WebAssembly;X86
# Prevent dependencies on some purely optional libraries, and a dependency on clang
# for compiler-rt and SPIRV-LLVM-Translator tests.
BASE_CMAKE_FLAGS: -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_LIBEDIT=OFF -DCOMPILER_RT_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_TESTS=OFF
# Although tags are supposed to trigger builds by default, they don't.
trigger:
- '*'
- refs/tags/ldc-v*
jobs:
- job: Windows
timeoutInMinutes: 180
pool:
vmImage: 'windows-2019'
variables:
CLANG_VERSION: 9.0.0
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\
EXTRA_CMAKE_FLAGS: -DLLVM_USE_CRT_RELEASE=MT
strategy:
matrix:
x64:
ARCH: x64
LLVM_DEFAULT_TARGET_TRIPLE: x86_64-pc-windows-msvc
LLVM_ENABLE_ASSERTIONS: OFF
x64_withAsserts:
ARCH: x64
LLVM_DEFAULT_TARGET_TRIPLE: x86_64-pc-windows-msvc
LLVM_ENABLE_ASSERTIONS: ON
x86:
ARCH: x86
LLVM_DEFAULT_TARGET_TRIPLE: i686-pc-windows-msvc
LLVM_ENABLE_ASSERTIONS: OFF
# Let CMake configure 64-bit clang-cl for 32-bit code emission.
CFLAGS: -m32
CXXFLAGS: -m32
ASMFLAGS: -m32
x86_withAsserts:
ARCH: x86
LLVM_DEFAULT_TARGET_TRIPLE: i686-pc-windows-msvc
LLVM_ENABLE_ASSERTIONS: ON
CFLAGS: -m32
CXXFLAGS: -m32
ASMFLAGS: -m32
steps:
- template: .azure-pipelines/windows.yml
- job: Linux
timeoutInMinutes: 180
pool:
vmImage: 'ubuntu-16.04'
variables:
CI_OS: linux
ARCH: x86_64
EXTRA_CMAKE_FLAGS: -DLLVM_BINUTILS_INCDIR=/usr/include -DCMAKE_CXX_FLAGS=-static-libstdc++
strategy:
matrix:
x64:
LLVM_ENABLE_ASSERTIONS: OFF
x64_withAsserts:
LLVM_ENABLE_ASSERTIONS: ON
steps:
- checkout: self
submodules: true
fetchDepth: 50
- script: |
set -ex
cd ..
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -q update
sudo apt-get -yq install \
git-core cmake ninja-build g++ binutils-dev python
displayName: Install prerequisites
- template: .azure-pipelines/posix.yml
- job: macOS
timeoutInMinutes: 180
pool:
vmImage: 'macOS-10.13'
variables:
CI_OS: osx
ARCH: x86_64
EXTRA_CMAKE_FLAGS: -DHAVE_FUTIMENS=0
MACOSX_DEPLOYMENT_TARGET: 10.9
strategy:
matrix:
x64:
LLVM_ENABLE_ASSERTIONS: OFF
x64_withAsserts:
LLVM_ENABLE_ASSERTIONS: ON
steps:
- checkout: self
submodules: true
fetchDepth: 50
- script: |
set -ex
cd ..
# Download & extract Ninja
curl -L -o ninja-mac.zip https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-mac.zip
mkdir ninja
tar -xf ninja-mac.zip -C ninja
displayName: Install prerequisites
- template: .azure-pipelines/posix.yml
- job: Android_armv7a
timeoutInMinutes: 180
pool:
vmImage: 'ubuntu-16.04'
variables:
CI_OS: android
ARCH: armv7a
LLVM_TARGETS_TO_BUILD: AArch64;ARM;WebAssembly;X86
LLVM_ENABLE_ASSERTIONS: OFF
EXTRA_CMAKE_FLAGS: -DANDROID_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_STL=c++_static -DCMAKE_CROSSCOMPILING=True -DLLVM_TARGET_ARCH=ARM -DLLVM_DEFAULT_TARGET_TRIPLE=armv7a--linux-androideabi -DLLVM_ENABLE_PLUGINS=OFF
steps:
- checkout: self
submodules: true
fetchDepth: 50
- script: |
set -ex
cd ..
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -q update
sudo apt-get -yq install \
git-core cmake ninja-build g++ curl python unzip
displayName: Install prerequisites
- script: |
set -ex
cd ..
cmake --version
ninja --version
mkdir build-native
cd build-native
cmake -G Ninja $BUILD_SOURCESDIRECTORY \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD="$LLVM_TARGETS_TO_BUILD" \
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="$LLVM_EXPERIMENTAL_TARGETS_TO_BUILD" \
-DLLVM_ENABLE_ASSERTIONS=$LLVM_ENABLE_ASSERTIONS \
$BASE_CMAKE_FLAGS
ninja llvm-tblgen
displayName: Build native llvm-tblgen
- script: |
set -ex
cd ..
# Download & extract Android NDK
curl -OL https://dl.google.com/android/repository/android-ndk-r20-linux-x86_64.zip
unzip android-ndk-r20-linux-x86_64.zip > /dev/null
rm android-ndk-r20-linux-x86_64.zip
# The NDK toolchain file enforces `-g` as base C[XX] flag - remove it to
# *significantly* reduce executable sizes
TOOLCHAIN_FILE=$PWD/android-ndk-r20/build/cmake/android.toolchain.cmake
sed -i 's|^ -g$||' $TOOLCHAIN_FILE
# Extend EXTRA_CMAKE_FLAGS for future steps
set +x
echo "##vso[task.setvariable variable=EXTRA_CMAKE_FLAGS]$EXTRA_CMAKE_FLAGS -DLLVM_TABLEGEN=$PWD/build-native/bin/llvm-tblgen -DLLVM_CONFIG_PATH=$PWD/build-native/bin/llvm-config -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE"
displayName: Set up cross-compilation
- template: .azure-pipelines/posix.yml
# Uploads the packages to a GitHub release.
- job: Upload_to_GitHub
timeoutInMinutes: 30
pool:
vmImage: 'ubuntu-16.04'
dependsOn:
- Windows
- Linux
- macOS
- Android_armv7a
# Only run for branches and tags, no PRs.
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/'), startsWith(variables['Build.SourceBranch'], 'refs/tags/')))
steps:
- checkout: none
- task: DownloadPipelineArtifact@0
inputs:
artifactName: windows-x64
targetPath: artifacts
- task: DownloadPipelineArtifact@0
inputs:
artifactName: windows-x64-withAsserts
targetPath: artifacts
- task: DownloadPipelineArtifact@0
inputs:
artifactName: windows-x86
targetPath: artifacts
- task: DownloadPipelineArtifact@0
inputs:
artifactName: windows-x86-withAsserts
targetPath: artifacts
- task: DownloadPipelineArtifact@0
inputs:
artifactName: linux-x86_64
targetPath: artifacts
- task: DownloadPipelineArtifact@0
inputs:
artifactName: linux-x86_64-withAsserts
targetPath: artifacts
- task: DownloadPipelineArtifact@0
inputs:
artifactName: osx-x86_64
targetPath: artifacts
- task: DownloadPipelineArtifact@0
inputs:
artifactName: osx-x86_64-withAsserts
targetPath: artifacts
- task: DownloadPipelineArtifact@0
inputs:
artifactName: android-armv7a
targetPath: artifacts
- bash: |
set -e
if [ "${BUILD_SOURCEBRANCH:0:10}" != "refs/tags/" ]; then
releaseTag=CI
isPreRelease=true
else
releaseTag=${BUILD_SOURCEBRANCH:10}
isPreRelease=false
fi
echo "##vso[task.setvariable variable=GITHUB_RELEASE_TAG]$releaseTag"
echo "##vso[task.setvariable variable=GITHUB_RELEASE_ISPRERELEASE]$isPreRelease"
displayName: Set GITHUB_RELEASE_{TAG,ISPRERELEASE} env variables
- task: GitHubRelease@0
inputs:
gitHubConnection: kinke
repositoryName: ldc-developers/llvm
action: edit
tag: $(GITHUB_RELEASE_TAG)
assets: artifacts/*
assetUploadMode: replace
isPreRelease: $(GITHUB_RELEASE_ISPRERELEASE)
addChangeLog: false
displayName: Upload artifacts to GitHub release