mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
111 lines
3.0 KiB
YAML
111 lines
3.0 KiB
YAML
name: Android Check
|
|
on:
|
|
workflow_dispatch: # Manual trigger
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
JAVA_HOME: /usr/lib/jvm/temurin-21-jdk-amd64 # Java 21 is required for Android Gradle 8 plugin
|
|
SKIP_MAP_DOWNLOAD: true
|
|
|
|
jobs:
|
|
lint:
|
|
name: Android Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Parallel submodules checkout
|
|
shell: bash
|
|
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
|
|
|
|
- name: Install protobuf
|
|
shell: bash
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y python3-pip
|
|
pip install "protobuf<3.21" --break-system-packages
|
|
|
|
- name: Configure repository
|
|
shell: bash
|
|
run: ./configure.sh
|
|
|
|
- name: Lint
|
|
shell: bash
|
|
working-directory: android
|
|
run: ./gradlew -Pandroidauto=true lint
|
|
|
|
android-check:
|
|
name: Build Android apps
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
flavor: [WebBeta, FdroidDebug]
|
|
include:
|
|
- flavor: WebBeta
|
|
arch: arm64
|
|
- flavor: FdroidDebug
|
|
arch: arm32
|
|
# Cancels previous jobs if the same branch or PR was updated again.
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ matrix.flavor }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
steps:
|
|
- name: Install build tools and dependencies
|
|
shell: bash
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y ninja-build \
|
|
qt6-base-dev \
|
|
qt6-declarative-dev \
|
|
qt6-positioning-dev \
|
|
libqt6svg6-dev \
|
|
optipng \
|
|
libfreetype-dev \
|
|
libharfbuzz-dev \
|
|
libxrandr-dev \
|
|
libxinerama-dev \
|
|
libxcursor-dev \
|
|
libxi-dev \
|
|
python3-pip \
|
|
zlib1g-dev
|
|
pip install "protobuf<3.21" --break-system-packages
|
|
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 200 # enough to get all commits for the current day
|
|
|
|
- name: Parallel submodules checkout
|
|
shell: bash
|
|
run: git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
|
|
|
|
- name: Configure ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
with:
|
|
key: ${{ github.workflow }}-${{ matrix.flavor }}
|
|
|
|
- name: Compile ${{ matrix.flavor }}
|
|
shell: bash
|
|
working-directory: android
|
|
env:
|
|
CMAKE_C_COMPILER_LAUNCHER: ccache
|
|
CMAKE_CXX_COMPILER_LAUNCHER: ccache
|
|
run: |
|
|
cmake --version
|
|
ninja --version
|
|
./gradlew -P${{ matrix.arch }} assemble${{ matrix.flavor }}
|
|
|
|
- name: Upload ${{ matrix.flavor }} apk
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: android-${{ matrix.flavor }}
|
|
path: android/app/build/outputs/apk/**/CoMaps-*.apk
|
|
if-no-files-found: error
|