-
-
Notifications
You must be signed in to change notification settings - Fork 14
241 lines (198 loc) · 6 KB
/
build.yaml
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
233
234
235
236
237
238
239
240
241
name: build
on:
# build on manual trigger from web interface
workflow_dispatch:
# build on automatic trigger from roc-toolkit
repository_dispatch:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * 1'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# build natively on desktop
desktop:
strategy:
fail-fast: false
matrix:
include:
# latest tested JDK
- os: linux
image: ubuntu-latest
jdk: 21
jacoco: yes
- os: osx
image: macos-latest
jdk: 21
jacoco: no
# oldest supported JDK
- os: linux
image: ubuntu-latest
jdk: 17
jacoco: no
- os: osx
image: macos-latest
jdk: 17
jacoco: no
name: desktop/${{ matrix.os }}-jdk${{ matrix.jdk }}
runs-on: ${{ matrix.image }}
env:
# TODO: set to master
ROC_REVISION: v0.2.6
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: temurin
- name: Install system dependencies
run: scripts/${{ matrix.os }}/install_dependencies.sh
- name: Install Roc
run: scripts/${{ matrix.os }}/build_roc.sh
- name: Build and test bindings
run: scripts/${{ matrix.os }}/build_bindings.sh
- name: Upload test coverage
if: ${{ github.repository_owner == 'roc-streaming' && matrix.jacoco == 'yes' }}
id: jacoco
uses: codecov/codecov-action@v3
with:
files: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
# build for Android on Linux (with Docker)
android-linux:
strategy:
fail-fast: false
matrix:
include:
# latest tested JDK, SDK, and NDK
- jdk: 21
sdk: 34
api: 29
ndk_r: 26d
ndk: 26.3.11579264
# oldest supported JDK, SDK, and NDK
- jdk: 17
sdk: 31
api: 29
ndk_r: 21e
ndk: 21.4.7075529
name: android/linux-jdk${{ matrix.jdk }}-sdk${{ matrix.sdk }}-ndk${{ matrix.ndk_r }}
runs-on: ubuntu-24.04
env:
# TODO: set to master
ROC_REVISION: v0.2.6
JAVA_VERSION: ${{ matrix.jdk }}
SDK_LEVEL: ${{ matrix.sdk }}
API_LEVEL: ${{ matrix.api }}
NDK_VERSION: ${{ matrix.ndk }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: scripts/android_docker.sh build
# build for Android on macOS
android-osx:
strategy:
fail-fast: false
matrix:
include:
# latest tested JDK, SDK, and NDK
- jdk: 21
sdk: 34
api: 29
ndk_r: 26d
ndk: 26.3.11579264
cmdline_tools: 10406996
build_tools: 35.0.0
cmake: 3.18.1
avd_image: default
avd_arch: x86_64
# oldest tested JDK, SDK, and NDK
- jdk: 17
sdk: 31
api: 29
ndk_r: 21e
ndk: 21.4.7075529
cmdline_tools: 10406996
build_tools: 28.0.3
cmake: 3.10.2.4988404
avd_image: default
avd_arch: x86_64
name: android/osx-jdk${{ matrix.jdk }}-sdk${{ matrix.sdk }}-ndk${{ matrix.ndk_r }}
runs-on: macos-13
env:
# TODO: set to master
ROC_REVISION: v0.2.6
SDK_LEVEL: ${{ matrix.sdk }}
API_LEVEL: ${{ matrix.api }}
NDK_VERSION: ${{ matrix.ndk }}
BUILD_TOOLS_VERSION: ${{ matrix.build_tools }}
CMAKE_VERSION: ${{ matrix.cmake }}
AVD_IMAGE: ${{ matrix.avd_image }}
AVD_ARCH: ${{ matrix.avd_arch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: temurin
- name: Install Android SDK
uses: android-actions/setup-android@v3
with:
cmdline-tools-version: ${{ matrix.cmdline_tools }}
- name: Install Android packages
run: |
sdkmanager \
"platforms;android-${{ matrix.sdk }}" \
"build-tools;${{ matrix.build_tools }}" \
"ndk;${{ matrix.ndk }}" \
"cmake;${{ matrix.cmake }}" \
"system-images;android-${{ matrix.sdk }};${{ matrix.avd_image }};${{ matrix.avd_arch }}" \
"emulator"
- name: Install system dependencies
run: scripts/android/install_dependencies.sh
- name: Build Roc
run: scripts/android/build_roc.sh
- name: Build bindings
run: scripts/android/build_bindings.sh
- name: Run Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api }}
arch: ${{ matrix.avd_arch }}
target: ${{ matrix.avd_image }}
avd-name: roc_device
ndk: ${{ matrix.ndk }}
cmake: ${{ matrix.cmake }}
script: ./scripts/android/run_instrumented_tests.sh
release:
needs: [desktop, android-linux, android-osx]
if: startsWith(github.ref, 'refs/tags/v')
name: publish
runs-on: ubuntu-24.04
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Choose roc-toolkit revision
run: echo ROC_REVISION=$(scripts/roc_revision.py) >> $GITHUB_ENV
- name: Publish
run: scripts/android_docker.sh publish