forked from getsentry/sentry-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
188 lines (184 loc) · 7.78 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
trigger:
- master
- release/*
stages:
- stage: test
displayName: Build & Test
jobs:
- job:
displayName: Lint
pool:
vmImage: "ubuntu-latest"
steps:
- checkout: self
- task: UsePythonVersion@0
- script: make style
displayName: Lint
- job:
strategy:
matrix:
Linux (gcc 7, 32-bit):
vmImage: "ubuntu-18.04"
CC: gcc-7
CXX: g++-7
TEST_X86: 1
Linux (gcc 10):
vmImage: "ubuntu-20.04"
CC: gcc-10
CXX: g++-10
# ERROR_ON_WARNINGS: 1
# The GCC analyzer 10.0.1 (as on CI) has an internal compiler error
# currently, and is not stable enough to activate.
# RUN_ANALYZER: gcc
Linux (clang 10 + asan + llvm-cov):
vmImage: "ubuntu-20.04"
CC: clang-10
CXX: clang++-10
ERROR_ON_WARNINGS: 1
RUN_ANALYZER: asan,llvm-cov
Linux (clang 10 + kcov):
vmImage: "ubuntu-20.04"
CC: clang-10
CXX: clang++-10
ERROR_ON_WARNINGS: 1
RUN_ANALYZER: kcov
Linux (code-checker + valgrind):
vmImage: "ubuntu-20.04"
RUN_ANALYZER: code-checker,valgrind
macOS (xcode llvm):
vmImage: "macOs-latest"
ERROR_ON_WARNINGS: 1
macOS (clang 10 + asan + llvm-cov):
vmImage: "macOs-latest"
CC: clang
CXX: clang++
ERROR_ON_WARNINGS: 1
RUN_ANALYZER: asan,llvm-cov
Windows (VS2017, 32bit):
vmImage: "vs2017-win2016"
TEST_X86: 1
Windows (latest):
vmImage: "windows-latest"
# MSYS2MinGW:
# vmImage: "windows-latest"
# CC: clang -fuse-ld=lld
# CXX: clang++ -fuse-ld=lld
# CMAKE_GENERATOR: Ninja
# MSYS_PATH : C:\tools\msys64
# The Android emulator is currently only available on macos, see:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/android?view=azure-devops#test-on-the-android-emulator
Android (API 16, NDK 19):
vmImage: "macOs-latest"
ANDROID_API: 16
ANDROID_NDK: 19.2.5345600
Android (API 29 NDK 21):
vmImage: "macOs-latest"
ANDROID_API: 29
ANDROID_NDK: 21.2.6472646
pool:
vmImage: $(vmImage)
steps:
- checkout: self
fetchDepth: 5
submodules: recursive
- task: UsePythonVersion@0
- script: sudo apt update && sudo apt install libcurl4 libcurl4-openssl-dev kcov g++-10 clang-10 clang-tools llvm valgrind
condition: and(eq(variables['Agent.OS'], 'Linux'), not(variables['TEST_X86']))
displayName: Installing Linux Dependencies
- script: |
sudo apt install clang-tidy curl doxygen gcc-multilib python3-dev python3-virtualenv
git clone https://github.com/Ericsson/CodeChecker.git --depth 1
cd CodeChecker
BUILD_LOGGER_64_BIT_ONLY=YES make standalone_package
echo "##vso[task.prependpath]$PWD/build/CodeChecker/bin"
condition: contains(variables['RUN_ANALYZER'], 'code-checker')
displayName: Installing CodeChecker
- script: sudo apt update && sudo apt install gcc-multilib g++-multilib
condition: and(eq(variables['Agent.OS'], 'Linux'), variables['TEST_X86'])
displayName: Installing Linux 32-bit Dependencies
- script: echo "##vso[task.prependpath]/usr/local/opt/llvm/bin/"
condition: eq(variables['Agent.OS'], 'Darwin')
displayName: Expose llvm PATH for Mac
# ignoring checksums: choco has 2.72, whereas upstream is 2.73
- script: choco install sigcheck --ignore-checksums
condition: eq(variables['Agent.OS'], 'Windows_NT')
displayName: Installing Windows Dependencies
- script: |
export ANDROID_IMAGE="system-images;android-$(ANDROID_API);google_apis;x86"
echo "Downloading ndk;$(ANDROID_NDK) and $ANDROID_IMAGE"
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install \
"ndk;$(ANDROID_NDK)" "$ANDROID_IMAGE" | \
grep -v "\[=" || true # suppress the progress bar, so we get meaningful logs
condition: variables['ANDROID_API']
displayName: Installing Android SDK Dependencies
- script: |
bash scripts/start-android.sh
condition: variables['ANDROID_API']
displayName: Starting Android Simulator
# - script: choco install --no-progress msys2
# condition: variables['MSYS_PATH']
# displayName: Install MSYS2
# - powershell: |
# echo '##vso[task.prependpath]$(MSYS_PATH)\mingw64\bin'
# echo '##vso[task.prependpath]$(MSYS_PATH)\usr\bin'
# condition: variables['MSYS_PATH']
# displayName: Update path with MSYS2
# - script: |
# pacman --noconfirm -S ^
# mingw-w64-x86_64-uasm ^
# mingw-w64-x86_64-clang ^
# mingw-w64-x86_64-lld ^
# mingw-w64-x86_64-ninja ^
# mingw-w64-x86_64-cmake
# condition: variables['MSYS_PATH']
# displayName: Install MSYS2 packages
- script: |
pip install --upgrade --requirement tests/requirements.txt
pytest --capture=no --verbose tests
displayName: Test
- script: |
ls -lah
bash <(curl -s https://codecov.io/bash) -s coverage -C $(Build.SourceVersion)
condition: contains(variables['RUN_ANALYZER'], 'cov')
displayName: "Upload to codecov.io"
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
- stage: package
displayName: Create Release Archive
dependsOn: test
condition: and(succeeded('test'), eq(variables['System.PullRequest.IsFork'], 'False'))
jobs:
- job:
pool:
vmImage: "ubuntu-latest"
steps:
- checkout: self
fetchDepth: 5
submodules: recursive
- task: DeleteFiles@1
displayName: Remove all files not belonging in source archive
inputs:
contents: |
build
.*
**/.git*
azure*
scripts
Makefile
external/breakpad/src/tools
external/breakpad/src/processor
- task: ArchiveFiles@2
displayName: Create source archive
inputs:
rootFolderOrFile: $(Build.SourcesDirectory)
includeRootFolder: false
archiveFile: "$(Build.ArtifactStagingDirectory)/sentry-native-source.zip"
- task: PublishBuildArtifacts@1
displayName: Publish source archive to Azure
inputs:
pathtoPublish: "$(Build.ArtifactStagingDirectory)/sentry-native-source.zip"
- script: |
npx -p "@zeus-ci/cli" zeus job update --build $(Build.BuildId) --job $(System.JobId) --ref $(Build.SourceVersion) --build-label "$(Build.BuildNumber)" --job-label "$(System.JobDisplayName)" --status passed
npx -p "@zeus-ci/cli" zeus upload --build $(Build.BuildId) --job $(System.JobId) --type "application/zip" --name "sentry-native.zip" "$(Build.ArtifactStagingDirectory)/sentry-native-source.zip"
env:
ZEUS_HOOK_BASE: $(ZEUS_HOOK_BASE)