-
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use 16-core GitHub runner Android (#2891)
- Loading branch information
Showing
3 changed files
with
67 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
.github/actions/android-build-and-upload-render-test/action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Build and Upload APKs | ||
description: Build the APK and Android test APK for a given flavor, and upload them as artifacts | ||
inputs: | ||
flavor: | ||
description: 'The build flavor (e.g., opengl, vulkan)' | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Build APK and Android Test APK for ${{ inputs.flavor }} | ||
shell: bash | ||
run: | | ||
./gradlew assemble${{ inputs.flavor }} assemble${{ inputs.flavor }}AndroidTest | ||
cp app/build/outputs/apk/${{ inputs.flavor }}/release/app-${{ inputs.flavor }}-release.apk RenderTestsApp-${{ inputs.flavor }}.apk | ||
cp app/build/outputs/apk/androidTest/${{ inputs.flavor }}/release/app-${{ inputs.flavor }}-release-androidTest.apk RenderTests-${{ inputs.flavor }}.apk | ||
working-directory: ./render-test/android | ||
|
||
- name: Upload APK files for ${{ inputs.flavor }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: android-render-tests-${{ inputs.flavor }} | ||
if-no-files-found: error | ||
path: | | ||
./render-test/android/RenderTestsApp-${{ inputs.flavor }}.apk | ||
./render-test/android/RenderTests-${{ inputs.flavor }}.apk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ jobs: | |
files_yaml_from_source_file: .github/changed-files.yml | ||
|
||
android-build: | ||
runs-on: ubuntu-22.04 | ||
runs-on: MapLibre_Native_Ubuntu_24_04_x84_16_core | ||
needs: | ||
- pre_job | ||
if: needs.pre_job.outputs.should_skip != 'true' | ||
|
@@ -48,18 +48,6 @@ jobs: | |
IS_LOCAL_DEVELOPMENT: false | ||
MLN_ANDROID_STL: c++_static | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
if: startsWith(runner.name, 'GitHub Actions') | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: false | ||
android: false | ||
dotnet: true | ||
haskell: true | ||
large-packages: true | ||
docker-images: true | ||
swap-storage: false | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
@@ -72,6 +60,12 @@ jobs: | |
distribution: "temurin" | ||
java-version: "17" | ||
|
||
- name: Get CMake and Ninja | ||
uses: lukka/get-cmake@latest | ||
with: | ||
cmakeVersion: 3.24.1 | ||
ninjaVersion: latest | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v4 | ||
env: | ||
|
@@ -96,14 +90,20 @@ jobs: | |
run: node platform/android/scripts/generate-style-code.mjs | ||
working-directory: . | ||
|
||
- uses: pre-commit/[email protected] | ||
- run: | | ||
python3 -m venv venv | ||
source venv/bin/activate | ||
pip3 install pre-commit | ||
- run: | | ||
source venv/bin/activate | ||
pre-commit run clang-format --all-files | ||
continue-on-error: true # this can mean files are modified, which is not an error | ||
with: | ||
extra_args: clang-format --all-files | ||
- uses: pre-commit/[email protected] | ||
with: | ||
extra_args: clang-format --all-files | ||
- run: | | ||
source venv/bin/activate | ||
pre-commit run clang-format --all-files | ||
rm -rf venv | ||
- uses: infotroph/tree-is-clean@v1 | ||
with: | ||
|
@@ -178,113 +178,42 @@ jobs: | |
platform/android/InstrumentationTestApp.apk | ||
platform/android/InstrumentationTests.apk | ||
android-build-cpp-test: | ||
runs-on: ubuntu-24.04 | ||
needs: | ||
- pre_job | ||
if: needs.pre_job.outputs.should_skip != 'true' | ||
defaults: | ||
run: | ||
working-directory: test/android | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: "temurin" | ||
java-version: "17" | ||
|
||
- name: Get CMake and Ninja | ||
uses: lukka/get-cmake@latest | ||
with: | ||
cmakeVersion: 3.24.1 | ||
ninjaVersion: latest | ||
|
||
- uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ github.job }} | ||
|
||
- name: Create data.zip in assets directory | ||
run: zip -r test/android/app/src/main/assets/data.zip -@ < test/android/app/src/main/assets/to_zip.txt | ||
working-directory: . | ||
|
||
- name: Build C++ Unit Tests App | ||
run: | | ||
./gradlew assembleDebug assembleAndroidTest | ||
cp app/build/outputs/apk/debug/app-debug.apk . | ||
cp app/build/outputs/apk/androidTest/release/app-release-androidTest.apk . | ||
- name: Store C++ Unit Tests .apk files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: android-cpp-tests | ||
if-no-files-found: error | ||
path: | | ||
./test/android/app-debug.apk | ||
./test/android/app-release-androidTest.apk | ||
android-build-render-test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
flavor: [opengl, vulkan] | ||
runs-on: ubuntu-latest | ||
needs: | ||
- pre_job | ||
if: needs.pre_job.outputs.should_skip != 'true' | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
if: startsWith(runner.name, 'GitHub Actions') | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: false | ||
android: false | ||
dotnet: true | ||
haskell: true | ||
large-packages: true | ||
docker-images: true | ||
swap-storage: false | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
fetch-depth: 0 | ||
|
||
- uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ github.job }} | ||
|
||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: "temurin" | ||
java-version: "17" | ||
- name: Create data.zip in assets directory | ||
run: zip -r test/android/app/src/main/assets/data.zip -@ < test/android/app/src/main/assets/to_zip.txt | ||
working-directory: . | ||
|
||
- name: Build Render Test App | ||
- name: Build C++ Unit Tests App | ||
working-directory: test/android | ||
run: | | ||
./gradlew assemble${{ matrix.flavor }} assemble${{ matrix.flavor }}AndroidTest | ||
cp app/build/outputs/apk/${{ matrix.flavor }}/release/app-${{ matrix.flavor }}-release.apk RenderTestsApp-${{ matrix.flavor }}.apk | ||
cp app/build/outputs/apk/androidTest/${{ matrix.flavor }}/release/app-${{ matrix.flavor }}-release-androidTest.apk RenderTests-${{ matrix.flavor }}.apk | ||
working-directory: ./render-test/android | ||
./gradlew assembleDebug assembleAndroidTest | ||
cp app/build/outputs/apk/debug/app-debug.apk . | ||
cp app/build/outputs/apk/androidTest/release/app-release-androidTest.apk . | ||
- name: Store Render Test .apk files | ||
- name: Store C++ Unit Tests .apk files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: android-render-tests-${{ matrix.flavor }} | ||
name: android-cpp-tests | ||
if-no-files-found: error | ||
path: | | ||
./render-test/android/RenderTestsApp-${{ matrix.flavor }}.apk | ||
./render-test/android/RenderTests-${{ matrix.flavor }}.apk | ||
./test/android/app-debug.apk | ||
./test/android/app-release-androidTest.apk | ||
- name: Build and Upload Render Test APKs for OpenGL | ||
uses: ./.github/actions/android-build-and-upload-render-test | ||
with: | ||
flavor: opengl | ||
|
||
- name: Build and Upload Render Test APKs for Vulkan | ||
uses: ./.github/actions/android-build-and-upload-render-test | ||
with: | ||
flavor: vulkan | ||
|
||
android-ci-result: | ||
runs-on: ubuntu-latest | ||
if: needs.pre_job.outputs.should_skip != 'true' && always() | ||
needs: | ||
- pre_job | ||
- android-build | ||
- android-build-render-test | ||
steps: | ||
- name: Mark result as failed | ||
if: needs.android-build.result != 'success' | ||
|