39
39
needs :
40
40
- pre_job
41
41
if : needs.pre_job.outputs.should_skip != 'true'
42
+ strategy :
43
+ fail-fast : false
44
+ matrix :
45
+ renderer : [opengl, vulkan]
42
46
defaults :
43
47
run :
44
48
working-directory : platform/android
81
85
cmakeVersion : 3.24.1
82
86
ninjaVersion : latest
83
87
84
- - name : Cache node modules
85
- uses : actions/cache@v4
86
- env :
87
- cache-name : cache-node-modules
88
- with :
89
- path : ~/.npm
90
- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
91
- restore-keys : |
92
- ${{ runner.os }}-build-${{ env.cache-name }}-
93
- ${{ runner.os }}-build-
94
- ${{ runner.os }}-
95
-
96
88
- uses : actions/setup-node@v4
97
89
with :
98
90
node-version-file : " .nvmrc"
@@ -141,18 +133,21 @@ jobs:
141
133
- ${{ env.cache-name }}
142
134
143
135
- name : Check code style
136
+ if : matrix.renderer == 'opengl'
144
137
run : make android-check
145
138
146
139
- name : Run Android unit tests
147
- run : make run-android-unit-test
140
+ run : RENDERER=${{ matrix.renderer }} make run-android-unit-test
148
141
149
142
- name : Build libmaplibre.so for arm-v8
150
- run : make android-lib-arm-v8
143
+ run : RENDERER=${{ matrix.renderer }} make android-lib-arm-v8
151
144
152
145
- name : Build API documentation
146
+ if : matrix.renderer == 'opengl'
153
147
run : ./gradlew dokkaGenerate
154
148
155
149
- name : Build Examples documentation
150
+ if : matrix.renderer == 'opengl'
156
151
run : make mkdocs-build
157
152
158
153
- name : Copy developer config with API key for UI tests
@@ -167,57 +162,52 @@ jobs:
167
162
168
163
- name : Build Benchmark, copy to platform/android
169
164
run : |
170
- ./gradlew assembleOpenglRelease assembleOpenglReleaseAndroidTest -PtestBuildType=release
171
- cp MapLibreAndroidTestApp/build/outputs/apk/opengl /release/MapLibreAndroidTestApp-opengl -release.apk .
172
- cp MapLibreAndroidTestApp/build/outputs/apk/androidTest/opengl /release/MapLibreAndroidTestApp-opengl -release-androidTest.apk .
165
+ ./gradlew assemble${{ matrix.renderer }}Release assemble${{ matrix.renderer }}ReleaseAndroidTest -PtestBuildType=release
166
+ cp MapLibreAndroidTestApp/build/outputs/apk/${{ matrix.renderer }} /release/MapLibreAndroidTestApp-${{ matrix.renderer }} -release.apk .
167
+ cp MapLibreAndroidTestApp/build/outputs/apk/androidTest/${{ matrix.renderer }} /release/MapLibreAndroidTestApp-${{ matrix.renderer }} -release-androidTest.apk .
173
168
174
169
# https://developer.android.com/guide/practices/page-sizes
175
170
- name : Check alignment of .apk
176
171
run : |
177
- unzip -o MapLibreAndroidTestApp/build/outputs/apk/opengl /release/MapLibreAndroidTestApp-opengl -release.apk -d /tmp/my_apk_out
172
+ unzip -o MapLibreAndroidTestApp/build/outputs/apk/${{ matrix.renderer }} /release/MapLibreAndroidTestApp-${{ matrix.renderer }} -release.apk -d /tmp/my_apk_out
178
173
scripts/check-alignment.sh /tmp/my_apk_out
179
174
180
175
- name : Create artifact for benchmark APKs
176
+ if : matrix.renderer == 'opengl'
181
177
uses : actions/upload-artifact@v4
182
178
with :
183
179
if-no-files-found : error
184
180
name : benchmarkAPKs
185
181
path : |
186
- platform/android/MapLibreAndroidTestApp-opengl -release.apk
187
- platform/android/MapLibreAndroidTestApp-opengl -release-androidTest.apk
182
+ platform/android/MapLibreAndroidTestApp-${{ matrix.renderer }} -release.apk
183
+ platform/android/MapLibreAndroidTestApp-${{ matrix.renderer }} -release-androidTest.apk
188
184
189
- - if : github.event_name == 'pull_request'
185
+ - if : github.event_name == 'pull_request' && matrix.renderer == 'opengl'
190
186
uses : ./.github/actions/save-pr-number
191
187
192
- - name : Build Instrumentation Tests (OpenGL), copy to platform/android
188
+ - name : Set renderer env var (OpenGL or Vulkan)
189
+ shell : bash
193
190
run : |
194
- ./gradlew assembleOpenglDebug assembleOpenglDebugAndroidTest -PtestBuildType=debug
195
- cp MapLibreAndroidTestApp/build/outputs/apk/opengl/debug/MapLibreAndroidTestApp-opengl-debug.apk InstrumentationTestAppOpenGL.apk
196
- cp MapLibreAndroidTestApp/build/outputs/apk/androidTest/opengl/debug/MapLibreAndroidTestApp-opengl-debug-androidTest.apk InstrumentationTestsOpenGL.apk
197
-
198
- - name : Upload android-ui-test-opengl
199
- uses : actions/upload-artifact@v4
200
- with :
201
- if-no-files-found : error
202
- name : android-ui-test-opengl
203
- path : |
204
- platform/android/InstrumentationTestAppOpenGL.apk
205
- platform/android/InstrumentationTestsOpenGL.apk
191
+ case "${{ matrix.renderer }}" in
192
+ opengl) echo "renderer=OpenGL" >> "$GITHUB_ENV" ;;
193
+ vulkan) echo "renderer=Vulkan" >> "$GITHUB_ENV" ;;
194
+ *) echo "::error ::Unknown renderer '${{ matrix.renderer }}'"; exit 1 ;;
195
+ esac
206
196
207
- - name : Build Instrumentation Tests, copy to platform/android
197
+ - name : Build Instrumentation Tests (${{ matrix.renderer }}) , copy to platform/android
208
198
run : |
209
- ./gradlew assembleVulkanDebug assembleVulkanDebugAndroidTest -PtestBuildType=debug
210
- cp MapLibreAndroidTestApp/build/outputs/apk/vulkan /debug/MapLibreAndroidTestApp-vulkan -debug.apk InstrumentationTestAppVulkan .apk
211
- cp MapLibreAndroidTestApp/build/outputs/apk/androidTest/vulkan /debug/MapLibreAndroidTestApp-vulkan -debug-androidTest.apk InstrumentationTestsVulkan .apk
199
+ ./gradlew assemble${{ matrix.renderer }}Debug assemble${{ matrix.renderer }}DebugAndroidTest -PtestBuildType=debug
200
+ cp MapLibreAndroidTestApp/build/outputs/apk/${{ matrix.renderer }} /debug/MapLibreAndroidTestApp-${{ matrix.renderer }} -debug.apk InstrumentationTestApp${{ env.renderer }} .apk
201
+ cp MapLibreAndroidTestApp/build/outputs/apk/androidTest/${{ matrix.renderer }} /debug/MapLibreAndroidTestApp-${{ matrix.renderer }} -debug-androidTest.apk InstrumentationTests${{ env.renderer }} .apk
212
202
213
- - name : Upload android-ui-test-vulkan
203
+ - name : Upload android-ui-test-${{ matrix.renderer }}
214
204
uses : actions/upload-artifact@v4
215
205
with :
216
206
if-no-files-found : error
217
- name : android-ui-test-vulkan
207
+ name : android-ui-test-${{ matrix.renderer }}
218
208
path : |
219
- platform/android/InstrumentationTestAppVulkan .apk
220
- platform/android/InstrumentationTestsVulkan .apk
209
+ platform/android/InstrumentationTestApp${{ env.renderer }} .apk
210
+ platform/android/InstrumentationTests${{ env.renderer }} .apk
221
211
222
212
android-build-cpp-test :
223
213
runs-on : ubuntu-24.04
0 commit comments