mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-18 08:54:37 +00:00
[ci] Fix android-check action (#3242)
Co-authored-by: x7z4w <x7z4w@noreply.codeberg.org> Reviewed-on: https://codeberg.org/comaps/comaps/pulls/3242 Reviewed-by: x7z4w <x7z4w@noreply.codeberg.org> Signed-off-by: zyphlar <zyphlar@gmail.com> Co-authored-by: zyphlar <zyphlar@gmail.com> Co-committed-by: zyphlar <zyphlar@gmail.com>
This commit is contained in:
@@ -34,19 +34,63 @@ on:
|
||||
- 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: Parallel submodules checkout
|
||||
- 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 update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
|
||||
run: |
|
||||
git submodule sync --recursive
|
||||
git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
|
||||
|
||||
- name: Lint
|
||||
shell: bash
|
||||
@@ -56,6 +100,9 @@ jobs:
|
||||
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:
|
||||
@@ -71,23 +118,32 @@ jobs:
|
||||
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
|
||||
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 200 # enough to get all commits for the current day
|
||||
|
||||
- name: Parallel submodules checkout
|
||||
- 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 update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
|
||||
run: |
|
||||
git submodule sync --recursive
|
||||
git submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20))
|
||||
|
||||
- name: Configure ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2
|
||||
uses: https://github.com/hendrikmuhs/ccache-action@v1.2
|
||||
with:
|
||||
key: ${{ github.workflow }}-${{ matrix.flavor }}
|
||||
|
||||
@@ -97,14 +153,11 @@ jobs:
|
||||
env:
|
||||
CMAKE_C_COMPILER_LAUNCHER: ccache
|
||||
CMAKE_CXX_COMPILER_LAUNCHER: ccache
|
||||
run: |
|
||||
cmake --version
|
||||
ninja --version
|
||||
./gradlew -P${{ matrix.arch }} assemble${{ matrix.flavor }}
|
||||
run: ./gradlew -P${{ matrix.arch }} assemble${{ matrix.flavor }}
|
||||
|
||||
- name: Upload ${{ matrix.flavor }} apk
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: android-${{ matrix.flavor }}
|
||||
path: android/app/build/outputs/apk/**/OrganicMaps-*.apk
|
||||
path: android/app/build/outputs/apk/**/*.apk
|
||||
if-no-files-found: error
|
||||
|
||||
@@ -153,7 +153,7 @@ project.afterEvaluate {
|
||||
|
||||
final taskName = gradle.startParameter.taskNames
|
||||
|
||||
if (['assemble', 'bundle', 'compile', 'install', 'run', 'publish'].any{taskName.any{task->task.startsWith(it)}}) {
|
||||
if (['assemble', 'bundle', 'compile', 'install', 'lint', 'publish', 'run'].any{taskName.any{task->task.startsWith(it)}}) {
|
||||
exec {
|
||||
workingDir '../..'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user