Add Sentry to MapLibreAndroidTestApp (#3716)

Co-authored-by: Bart Louwers <bart@emeel.net>
Co-authored-by: Bart Louwers <bart.louwers@gmail.com>
This commit is contained in:
Adrian Cojocaru
2025-08-14 16:49:02 +03:00
committed by GitHub
parent 213d1c6187
commit 8908056d5f
7 changed files with 288 additions and 76 deletions

View File

@@ -0,0 +1,87 @@
name: setup-android-ci
description: "Sets up Android CI environment"
runs:
using: "composite"
steps:
- name: Free Disk Space (Ubuntu)
if: startsWith(runner.name, 'GitHub Actions')
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: false
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: false
- name: Validate VERSION
run: .github/scripts/validate-version.sh platform/android/VERSION
working-directory: .
shell: bash
- run: echo "cmake.dir=$(dirname "$(dirname "$(command -v cmake)")")" >> local.properties
shell: bash
- 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: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: npm install
run: npm install --ignore-scripts
working-directory: .
shell: bash
- name: run platform/android/scripts/generate-style-code.mjs
run: node platform/android/scripts/generate-style-code.mjs
working-directory: .
shell: bash
- run: |
python3 -m venv venv
source venv/bin/activate
pip3 install pre-commit
shell: bash
- 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
shell: bash
- run: |
source venv/bin/activate
pre-commit run clang-format --all-files
rm -rf venv
shell: bash
- uses: infotroph/tree-is-clean@v1
with:
check_untracked: true
- uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}
append-timestamp: false
max-size: 5G
- name: restore-gradle-cache
uses: actions/cache@v4
env:
cache-name: gradle-v1
with:
path: ~/.gradle
key: ${{ env.cache-name }}-${{ hashFiles('platform/android/buildSrc/src/main/kotlin/maplibre.dependencies.gradle.kts') }}-${{ hashFiles('platform/android/build.gradle.kts') }}-${{ hashFiles('platform/android/local.properties') }}-${{ hashFiles('platform/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
- ${{ env.cache-name }}

View File

@@ -51,86 +51,12 @@ 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: true
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
- name: Validate VERSION
run: .github/scripts/validate-version.sh platform/android/VERSION
working-directory: .
- run: echo "cmake.dir=$(dirname "$(dirname "$(command -v cmake)")")" >> local.properties
- 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: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: npm install
run: npm install --ignore-scripts
working-directory: .
- name: run platform/android/scripts/generate-style-code.mjs
run: node platform/android/scripts/generate-style-code.mjs
working-directory: .
- 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
- run: |
source venv/bin/activate
pre-commit run clang-format --all-files
rm -rf venv
- uses: infotroph/tree-is-clean@v1
with:
check_untracked: true
- uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}
append-timestamp: false
max-size: 5G
- name: restore-gradle-cache
uses: actions/cache@v4
env:
cache-name: gradle-v1
with:
path: ~/.gradle
key: ${{ env.cache-name }}-${{ hashFiles('platform/android/buildSrc/src/main/kotlin/maplibre.dependencies.gradle.kts') }}-${{ hashFiles('platform/android/build.gradle.kts') }}-${{ hashFiles('platform/android/local.properties') }}-${{ hashFiles('platform/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
- ${{ env.cache-name }}
- uses: ./.github/actions/setup-android-ci
- name: Check code style
if: matrix.renderer == 'opengl'

View File

@@ -0,0 +1,61 @@
name: android-testapp-release
permissions:
contents: write
on:
workflow_dispatch:
jobs:
create-android-testapp-release:
runs-on: ubuntu-latest
steps:
- name: Create Release
run: |
gh release create android-testapp-${{ github.sha }} \
--draft=false \
--prerelease=false \
--latest=false \
--title android-testapp-${{ github.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
android-build-testapp:
needs: [create-android-testapp-release]
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
renderer: [opengl, vulkan]
defaults:
run:
working-directory: platform/android
env:
BUILDTYPE: Debug
IS_LOCAL_DEVELOPMENT: false
MLN_ANDROID_STL: c++_static
SENTRY_ORG: maplibre
SENTRY_PROJECT: maplibre-android
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN_ANDROID }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: ./.github/actions/setup-android-ci
- run: ./gradlew assemble${{ matrix.renderer }}Release
- name: Install sentry-cli
run: curl -sL https://sentry.io/get-cli/ | sh
- name: Upload debug symbols to sentry
run: sentry-cli debug-files upload MapLibreAndroidTestApp
- name: Upload Linux artifact
run: |
gh release upload android-testapp-${{ github.sha }} MapLibreAndroidTestApp/build/outputs/apk/${{ matrix.renderer }}/release/MapLibreAndroidTestApp-${{ matrix.renderer }}-release.apk
env:
GH_TOKEN: ${{ github.token }}