-
-
Notifications
You must be signed in to change notification settings - Fork 171
207 lines (188 loc) · 6.97 KB
/
ci.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
name: CI
on:
push:
branches:
- master
- "release/**"
pull_request:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
sudo apt update
sudo apt install clang-format-15
make style-15
build-ios:
name: Xcode Build for iOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- run: |
cmake -B sentry-native-xcode -GXcode -DCMAKE_SYSTEM_NAME=iOS
xcodebuild build -project sentry-native-xcode/Sentry-Native.xcodeproj -sdk iphonesimulator
test:
strategy:
fail-fast: false
matrix:
include:
- name: Linux (old gcc, 32-bit)
os: ubuntu-20.04
CC: gcc-7
CXX: g++-7
TEST_X86: 1
- name: Linux (new gcc)
os: ubuntu-22.04
CC: gcc-12
CXX: g++-12
# 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
- name: Linux (clang + asan + llvm-cov)
os: ubuntu-22.04
CC: clang-14
CXX: clang++-14
ERROR_ON_WARNINGS: 1
RUN_ANALYZER: asan,llvm-cov
- name: Linux (clang + kcov)
os: ubuntu-22.04
CC: clang-14
CXX: clang++-14
ERROR_ON_WARNINGS: 1
RUN_ANALYZER: kcov
- name: Linux (gcc + code-checker + valgrind)
os: ubuntu-22.04
RUN_ANALYZER: code-checker,valgrind
- name: macOS (xcode llvm)
os: macOs-11
ERROR_ON_WARNINGS: 1
SYSTEM_VERSION_COMPAT: 0
- name: macOS (xcode llvm + universal)
os: macOs-11
ERROR_ON_WARNINGS: 1
SYSTEM_VERSION_COMPAT: 0
CMAKE_DEFINES: -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64
- name: macOS (clang + asan + llvm-cov)
os: macOs-11
CC: clang
CXX: clang++
ERROR_ON_WARNINGS: 1
SYSTEM_VERSION_COMPAT: 0
RUN_ANALYZER: asan,llvm-cov
- name: Windows (old VS, 32-bit)
os: windows-2019
TEST_X86: 1
- name: Windows (latest)
os: windows-latest
- name: LLVM-Mingw
os: windows-latest
TEST_MINGW: 1
MINGW_PKG_PREFIX: x86_64-w64-mingw32
MINGW_ASM_MASM_COMPILER: llvm-ml;-m64
# 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
- name: Android (old API/NDK)
os: macOs-latest
ANDROID_API: 16
ANDROID_NDK: 20.1.5948944
ANDROID_ARCH: x86
- name: Android (new API/NDK)
os: macOs-latest
ANDROID_API: 32
ANDROID_NDK: 25.0.8775105
ANDROID_ARCH: x86_64
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
TEST_X86: ${{ matrix.TEST_X86 }}
TEST_MINGW: ${{ matrix.TEST_MINGW }}
ERROR_ON_WARNINGS: ${{ matrix.ERROR_ON_WARNINGS }}
RUN_ANALYZER: ${{ matrix.RUN_ANALYZER }}
ANDROID_API: ${{ matrix.ANDROID_API }}
ANDROID_NDK: ${{ matrix.ANDROID_NDK }}
ANDROID_ARCH: ${{ matrix.ANDROID_ARCH }}
CMAKE_DEFINES: ${{ matrix.CMAKE_DEFINES }}
SYSTEM_VERSION_COMPAT: ${{ matrix.SYSTEM_VERSION_COMPAT }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Installing Linux Dependencies
if: ${{ runner.os == 'Linux' && !env['TEST_X86'] }}
run: |
sudo apt update
sudo apt install cmake clang-14 clang-tools llvm kcov g++-12 valgrind zlib1g-dev libcurl4-openssl-dev
- name: Installing Linux 32-bit Dependencies
if: ${{ runner.os == 'Linux' && env['TEST_X86'] }}
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install cmake gcc-7-multilib g++-7-multilib zlib1g-dev:i386 libssl-dev:i386 libcurl4-openssl-dev:i386
- name: Installing CodeChecker
if: ${{ contains(env['RUN_ANALYZER'], 'code-checker') }}
run: sudo snap install codechecker --classic
- name: Expose llvm PATH for Mac
if: ${{ runner.os == 'macOS' }}
run: echo $(brew --prefix llvm@15)/bin >> $GITHUB_PATH
- name: Installing LLVM-MINGW Dependencies
if: ${{ runner.os == 'Windows' && env['TEST_MINGW'] }}
shell: powershell
env:
MINGW_PKG_PREFIX: ${{ matrix.MINGW_PKG_PREFIX }}
MINGW_ASM_MASM_COMPILER: ${{ matrix.MINGW_ASM_MASM_COMPILER }}
run: . "scripts\install-llvm-mingw.ps1"
- name: Installing Android SDK Dependencies
if: ${{ env['ANDROID_API'] }}
run: |
export ANDROID_IMAGE="system-images;android-$ANDROID_API;google_apis;$ANDROID_ARCH"
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
- name: Starting Android Simulator
if: ${{ env['ANDROID_API'] }}
run: bash scripts/start-android.sh
timeout-minutes: 10
- name: Test
shell: bash
run: |
pip install --upgrade --requirement tests/requirements.txt
[ "${{ matrix.CC }}" ] && export CC="${{ matrix.CC }}"
[ "${{ matrix.CXX }}" ] && export CXX="${{ matrix.CXX }}"
pytest --capture=no --verbose tests
- name: "Upload to codecov.io"
if: ${{ contains(env['RUN_ANALYZER'], 'cov') }}
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # pin@v3
with:
directory: coverage
archive:
name: Create Release Archive
runs-on: ubuntu-latest
needs: [lint, test]
# only run this on pushes, combined with the CI triggers, this will only
# run on master or the release branch
if: ${{ needs.test.result == 'success' && github.event_name == 'push' }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Create source archive
run: |
rm -rf build .c* .e* .git* scripts Makefile external/breakpad/src/tools external/breakpad/src/processor
zip -r sentry-native.zip .
- name: Upload source artifact
uses: actions/upload-artifact@v3
with:
name: ${{ github.sha }}
# When downloading artifacts, they are double-zipped:
# https://github.com/actions/upload-artifact#zipped-artifact-downloads
path: sentry-native.zip