name: Android Check on: workflow_dispatch: # Manual trigger push: branches: - main pull_request: paths-ignore: - .gitignore - .forgejo/** - '!.forgejo/workflows/android-check.yaml' # Run check on self change - '**/*_tests/**' - CONTRIBUTORS - LICENSE - NOTICE - README.md - android/app/src/fdroid/** - android/app/src/google/** - iphone/** - data/strings/** - docs/** - generator/** - packaging/** - platform/*apple* - platform/*_ios* - platform/*_linux* - platform/*_mac* - platform/*qt* - platform/*_win* - pyhelpers/** - qt*/** - skin_generator/** - tools/** - track_generator/** - xcode/** env: SUBMODULE_CACHE_PATHS: | .git/modules 3party/CMake-MetalShaderSupport 3party/Vulkan-Headers 3party/boost 3party/expat 3party/fast_double_parser 3party/fast_obj 3party/freetype/freetype 3party/gflags 3party/glaze 3party/glfw 3party/glm 3party/googletest 3party/harfbuzz/harfbuzz 3party/icu/icu 3party/imgui/imgui 3party/jansson/jansson 3party/just_gtfs 3party/protobuf/protobuf 3party/pugixml/pugixml 3party/utfcpp tools/kothic tools/osmctools jobs: lint: name: Android Lint runs-on: ubuntu-latest container: image: codeberg.org/comaps/docker-android-sdk:ubuntu-standalone-zy-docker options: --user root steps: - name: Checkout sources uses: actions/checkout@v4 with: fetch-depth: 1 - name: Cache world map uses: actions/cache@v4 with: path: data/world_mwm key: world-mwm - uses: actions/cache@v4 with: path: ${{ env.SUBMODULE_CACHE_PATHS }} key: submodules-${{ hashFiles('.gitmodules') }} restore-keys: | submodules- - name: Sync and update submodules shell: bash run: | git submodule sync --recursive git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20)) - name: Lint shell: bash working-directory: android run: ./gradlew -Pandroidauto=true lint android-check: name: Build Android Debug runs-on: ubuntu-latest container: image: codeberg.org/comaps/docker-android-sdk:ubuntu-standalone-zy-docker options: --user root strategy: fail-fast: false matrix: flavor: [WebDebug, FdroidDebug] include: - flavor: WebDebug 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: Checkout sources uses: actions/checkout@v4 with: fetch-depth: 200 # enough to get all commits for the current day - name: Cache world map uses: actions/cache@v4 with: path: data/world_mwm key: world-mwm - uses: actions/cache@v4 with: path: ${{ env.SUBMODULE_CACHE_PATHS }} key: submodules-${{ hashFiles('.gitmodules') }} restore-keys: | submodules- - name: Sync and update submodules shell: bash run: | git submodule sync --recursive git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20)) - name: Configure ccache uses: https://github.com/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: ./gradlew -P${{ matrix.arch }} assemble${{ matrix.flavor }} - name: Upload ${{ matrix.flavor }} apk uses: actions/upload-artifact@v3 with: name: android-${{ matrix.flavor }} path: android/app/build/outputs/apk/**/*.apk if-no-files-found: error