-
-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow android-ci to be run on free GitHub runnner (#2984)
- Loading branch information
Showing
2 changed files
with
101 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,19 +35,30 @@ jobs: | |
files_yaml_from_source_file: .github/changed-files.yml | ||
|
||
android-build: | ||
runs-on: MapLibre_Native_Ubuntu_24_04_x84_16_core | ||
runs-on: ubuntu-24.04 | ||
needs: | ||
- pre_job | ||
if: needs.pre_job.outputs.should_skip != 'true' | ||
defaults: | ||
run: | ||
working-directory: platform/android | ||
env: | ||
JOBS: 8 | ||
BUILDTYPE: Debug | ||
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 | ||
|
@@ -80,7 +91,7 @@ jobs: | |
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
node-version-file: ".nvmrc" | ||
|
||
- name: npm install | ||
run: npm install --ignore-scripts | ||
|
@@ -94,11 +105,11 @@ jobs: | |
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 | ||
continue-on-error: true # this can mean files are modified, which is not an error | ||
- run: | | ||
source venv/bin/activate | ||
|
@@ -151,7 +162,7 @@ jobs: | |
cp MapLibreAndroidTestApp/build/outputs/apk/drawable/release/MapLibreAndroidTestApp-drawable-release.apk . | ||
cp MapLibreAndroidTestApp/build/outputs/apk/androidTest/drawable/release/MapLibreAndroidTestApp-drawable-release-androidTest.apk . | ||
- name: Create artifact for benchmark APKs | ||
- name: Create artifact for benchmark APKs | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
if-no-files-found: error | ||
|
@@ -178,12 +189,43 @@ 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 | ||
working-directory: test/android | ||
run: | | ||
./gradlew assembleDebug assembleAndroidTest | ||
cp app/build/outputs/apk/debug/app-debug.apk . | ||
|
@@ -198,22 +240,65 @@ jobs: | |
./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 | ||
android-build-render-test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
flavor: [opengl, vulkan] | ||
|
||
runs-on: ubuntu-24.04 | ||
|
||
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 }} | ||
|
||
- name: Get CMake and Ninja | ||
uses: lukka/get-cmake@latest | ||
with: | ||
flavor: opengl | ||
|
||
- name: Build and Upload Render Test APKs for Vulkan | ||
cmakeVersion: 3.24.1 | ||
ninjaVersion: latest | ||
|
||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: "temurin" | ||
java-version: "17" | ||
|
||
- name: Build and Upload Render Test APKs (${{ matrix.flavor }}) | ||
uses: ./.github/actions/android-build-and-upload-render-test | ||
with: | ||
flavor: vulkan | ||
flavor: ${{ matrix.flavor }} | ||
|
||
android-ci-result: | ||
runs-on: ubuntu-latest | ||
if: needs.pre_job.outputs.should_skip != 'true' && always() | ||
needs: | ||
- pre_job | ||
- android-build | ||
- android-build-cpp-test | ||
- android-build-render-test | ||
steps: | ||
- name: Mark result as failed | ||
if: needs.android-build.result != 'success' | ||
|
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