-
Notifications
You must be signed in to change notification settings - Fork 32
204 lines (163 loc) · 6.32 KB
/
main.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
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "backtrace" branch
push:
branches: ["backtrace"]
pull_request:
branches: ["backtrace"]
schedule:
- cron: "0 0 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
generator: ["Unix Makefiles", Ninja]
steps:
# Install latest CMake.
- uses: lukka/get-cmake@latest
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install curl headers
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
- name: CMake
run: |
mkdir cbuild
cmake -S . -B cbuild/ -DCRASHPAD_BUILD_EXAMPLES=TRUE -G "${{ matrix.generator }}"
cmake --build cbuild/
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1"
working-directory: ./backtrace/test
bundler-cache: true
- name: Run tests
working-directory: ./backtrace/test
run: >
bundle exec ruby ./test.rb -v
- name: Crashpad distribution ZIP
run: |
ruby backtrace/save_artifacts.rb --output Crashpad_Linux_build.zip
- uses: actions/upload-artifact@v3
with:
name: Crashpad_Linux_build_${{ github.sha }}
path: Crashpad_Linux_build.zip
build-windows:
# Because we want to use Visual Studio 16 2019, we need to use the windows-2019 GitHub runner
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
generator: ["Visual Studio 16 2019", Ninja]
steps:
# Install latest CMake.
- uses: lukka/get-cmake@latest
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Add cl.exe to PATH
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: CMake
run: |
# make a build directory (note: build is already used by Crashpad)
mkdir cbuild
# run CMake (additional options like -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE are possible)
# it is recommended to specify the compiler version used for the build
cmake -S . -B cbuild/ -DCRASHPAD_BUILD_EXAMPLES=TRUE -G "${{ matrix.generator }}" -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_C_COMPILER=cl.exe
cmake --build cbuild/
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1"
working-directory: ./backtrace/test
bundler-cache: true
- name: Run tests
working-directory: ./backtrace/test
run: |
bundle exec ruby ./test.rb -v
- name: Crashpad distribution ZIP
run: |
ruby backtrace/save_artifacts.rb --output Crashpad_Windows_build.zip
- uses: actions/upload-artifact@v3
with:
name: Crashpad_Windows_build_${{ github.sha }}
path: Crashpad_Windows_build.zip
build-macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
arch: [arm64, x86_64]
generator: ["Unix Makefiles", Ninja]
steps:
# Install latest CMake.
- uses: lukka/get-cmake@latest
- uses: actions/checkout@v3
with:
submodules: recursive
- name: CMake
run: |
mkdir cbuild
cmake -S . -B cbuild/ -DCRASHPAD_BUILD_EXAMPLES=TRUE -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -G "${{ matrix.generator }}"
cmake --build cbuild/
- uses: ruby/setup-ruby@v1
with:
working-directory: ./backtrace/test
ruby-version: "3.1"
bundler-cache: true
- name: Crashpad distribution ZIP
run: |
ruby backtrace/save_artifacts.rb --output Crashpad_MacOs_build_${{ matrix.arch }}.zip
- uses: actions/upload-artifact@v3
with:
name: Crashpad_MacOs_build_${{ matrix.arch }}_${{ github.sha }}
path: Crashpad_MacOs_build_${{ matrix.arch }}.zip
build-android:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# supported are: armeabi-v7a, arm64-v8a, x86_64. x86 (32-bit) is NOT supported
abi: [armeabi-v7a, arm64-v8a, x86_64]
# 64 bit architectures will always have min API level 21 https://stackoverflow.com/a/56467008
apiLevel: [21, 33]
ndk: [25.1.8937393]
include:
- apiLevel: 16
abi: armeabi-v7a
ndk: 25.1.8937393
steps:
# Install latest CMake.
- uses: lukka/get-cmake@latest
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set env armeabi-v7a
if: ${{ matrix.abi == 'armeabi-v7a' }}
run: echo "SSL_MODE=NONE" >> $GITHUB_ENV
- name: Set env others
if: ${{ matrix.abi != 'armeabi-v7a' }}
run: echo "SSL_MODE=OPENSSL" >> $GITHUB_ENV
- name: Install NDK (optional)
# available on GitHub Actions host (as of 7/24/22) listed below
if: ${{ matrix.ndk }} != '21.4.7075529' && ${{ matrix.ndk }} != '23.2.8568313' && ${{ matrix.ndk }} != '24.0.8215888'
run: |
echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "ndk;${{ matrix.ndk }}" --sdk_root=${ANDROID_SDK_ROOT}
#ls -lsa $ANDROID_HOME/ndk/${{ matrix.ndk }}/platforms
- name: CMake
run: |
mkdir cbuild
cmake -S . -B cbuild/ -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk/${{ matrix.ndk }}/build/cmake/android.toolchain.cmake -DANDROID_ABI=${{ matrix.abi }} -DANDROID_PLATFORM=android-${{ matrix.apiLevel }} -DANDROID_NATIVE_API_LEVEL=${{ matrix.apiLevel }} -DANDROID_TOOLCHAIN=clang -DCRASHPAD_HTTPS_TRANSPORT=${{ env.SSL_MODE }} -DCRASHPAD_BUILD_EXAMPLES=TRUE
cmake --build cbuild/
- name: Crashpad distribution ZIP
run: |
ruby backtrace/save_artifacts.rb --output Crashpad_Android_ndk${{ matrix.ndk }}_apiLevel${{ matrix.apiLevel }}_${{ matrix.abi }}_build.zip
- uses: actions/upload-artifact@v3
with:
name: Crashpad_Android_ndk${{ matrix.ndk }}_apiLevel${{ matrix.apiLevel }}_${{ matrix.abi }}_build_${{ github.sha }}
path: Crashpad_Android_ndk${{ matrix.ndk }}_apiLevel${{ matrix.apiLevel }}_${{ matrix.abi }}_build.zip