diff --git a/.github/workflows/android-ci.yml b/.github/workflows/android-ci.yml index 724242f1f..81d789aeb 100644 --- a/.github/workflows/android-ci.yml +++ b/.github/workflows/android-ci.yml @@ -125,7 +125,6 @@ jobs: cp MapboxGLAndroidSDKTestApp/build/outputs/apk/drawable/release/MapboxGLAndroidSDKTestApp-drawable-release.apk . cp MapboxGLAndroidSDKTestApp/build/outputs/apk/androidTest/drawable/release/MapboxGLAndroidSDKTestApp-drawable-release-androidTest.apk . - - name: Create artifact for benchmark APKs uses: actions/upload-artifact@v3 if: github.ref != 'refs/heads/main' @@ -136,6 +135,9 @@ jobs: platform/android/MapboxGLAndroidSDKTestApp-drawable-release.apk platform/android/MapboxGLAndroidSDKTestApp-drawable-release-androidTest.apk + - if: github.event_name == 'pull_request' + uses: ./.github/actions/save-pr-number + - name: Build UI tests if: github.ref == 'refs/heads/main' run: make android-ui-test-arm-v8 diff --git a/.github/workflows/android-device-test.yml b/.github/workflows/android-device-test.yml index 30595408f..b028cdd3f 100644 --- a/.github/workflows/android-device-test.yml +++ b/.github/workflows/android-device-test.yml @@ -47,7 +47,20 @@ jobs: app_id: ${{ secrets.MAPLIBRE_NATIVE_BOT_APP_ID }} private_key: ${{ secrets.MAPLIBRE_NATIVE_BOT_PRIVATE_KEY }} + - run: echo ${{ toJSON(github.event.workflow_run) }} + + - uses: ./.github/actions/get-pr-number + id: get-pr-number + + - name: Check if comment on PR contains '!benchmark android' + uses: peter-evans/find-comment@v2 + id: fc + with: + issue-number: ${{ steps.get-pr-number.outputs.pr-number }} + body-regex: '^!benchmark.*android.*$' + - uses: LouisBrunner/checks-action@v1.6.2 + if: matrix.test.name != 'Android Benchmark' || steps.fc.outputs.comment-id id: create_check with: token: ${{ steps.generate_token.outputs.token }} @@ -57,17 +70,19 @@ jobs: sha: ${{ github.event.workflow_run.head_sha }} - uses: ./.github/actions/download-workflow-run-artifact + if: matrix.test.name != 'Android Benchmark' || steps.fc.outputs.comment-id with: artifact-name: ${{ matrix.test.artifactName }} - name: Check if test files exist (otherwise the parent workflow was skipped) + if: matrix.test.name != 'Android Benchmark' || steps.fc.outputs.comment-id id: check_files uses: andstor/file-existence-action@v2.0.0 with: files: "${{ matrix.test.testFile }}, ${{ matrix.test.appFile }}" - uses: ./.github/actions/aws-device-farm-run - if: steps.check_files.outputs.files_exists == 'true' + if: steps.check_files.outputs.files_exists == 'true' && (matrix.test.name != 'Android Benchmark' || steps.fc.outputs.comment-id) with: name: ${{ matrix.test.name }} appType: ANDROID_APP @@ -75,6 +90,7 @@ jobs: testFile: ${{ matrix.test.testFile }} testPackageType: INSTRUMENTATION_TEST_PACKAGE testType: INSTRUMENTATION + testFilter: ${{ matrix.test.testFilter }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_ROLE_TO_ASSUME: ${{ vars.AWS_ROLE_TO_ASSUME }} @@ -83,7 +99,7 @@ jobs: externalData: ${{ matrix.test.externalData }} - uses: LouisBrunner/checks-action@v1.6.2 - if: always() + if: always() && (matrix.test.name != 'Android Benchmark' || steps.fc.outputs.comment-id) with: token: ${{ steps.generate_token.outputs.token }} check_id: ${{ steps.create_check.outputs.check_id }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cc8f58475..34af96905 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,19 +11,6 @@ git clone --recurse-submodules https://github.com/maplibre/maplibre-native.git ``` -## Building - -MapLibre Native shares a single C++ core library with all platforms. To build it, we utilize CMake. - -To build, run the following from the root directory -```bash -cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DMLN_WITH_CORE_ONLY=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMLN_WITH_COVERAGE=ON -``` - -`CMAKE_BUILD_TYPE=Debug` will build debug artifacts. You can opt to omit it if that is not necessary. -`MLN_WITH_CORE_ONLY=ON` will build only the core libraries. -Built artifacts should be available on `build` folder. - ## Guidelines @@ -33,12 +20,18 @@ If you want to contribute code: 1. Ensure that existing [pull requests](https://github.com/maplibre/maplibre-native/pulls) and [issues](https://github.com/maplibre/maplibre-native/issues) don’t already cover your contribution or question. -1. Pull requests are gladly accepted. If there are any changes that developers using one of the GL SDKs should be aware of, please update the **main** section of the relevant `CHANGELOG.md`. - -4. Prefix your commit messages with the platform(s) your changes affect, e.g. `[ios]`. +1. Pull requests are gladly accepted. If there are any changes that developers using one of the platforms should be aware of, please update the **main** section of the relevant `CHANGELOG.md`. Please note the special instructions for contributing new source code files, asset files, or user-facing strings to MapLibre Native for [iOS](platform/ios/CONTRIBUTING.md), [Android](platform/android/DEVELOPING.md) or [macOS](platform/macos/DEVELOPING.md). +## Pull Requests + +To run the benchmarks (for Android) include the following line on a PR comment: + +``` +!benchmark android +``` + ## Design Proposals If you would like to change MapLibre Native in a substantial way, we recommend that you write a Design Proposal. Examples for substantial changes could be if you would like to split the mono-repo or if you would like to introduce shaders written in Metal.