Skip to content

Improve coverage

Improve coverage #502

Workflow file for this run

name: Android
# See https://medium.com/@dcostalloyd90/automating-android-builds-with-github-actions-a-step-by-step-guide-2a02a54f59cd
on:
push:
paths:
- "CMakeLists.txt"
- "**/workflows/build_android.yml"
- "**/cmake/**"
- "**/examples/**"
- "**/modules/**"
- "**/tests/**"
- "**/thirdparty/**"
- "!**/native/*_apple.*"
- "!**/native/*_emscripten.*"
- "!**/native/*_ios.*"
- "!**/native/*_linux.*"
- "!**/native/*_mac.*"
- "!**/native/*_wasm.*"
- "!**/native/*_windows.*"
branches:
- "**"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
JAVA_VERSION: 17
JAVA_DISTRIBUTION: 'temurin'
NDK_VERSION: r26d
jobs:
configure:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: ${{env.JAVA_DISTRIBUTION}}
java-version: ${{env.JAVA_VERSION}}
- name: Setup Android SDK
uses: android-actions/setup-android@v2.0.10
- name: Setup Android NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: ${{env.NDK_VERSION}}
- name: Configure
run: cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_TARGET_ANDROID=ON -DYUP_ENABLE_TESTS=ON -DYUP_ENABLE_EXAMPLES=ON
- name: Cache Configure
id: cache-build
uses: actions/cache/save@v4
with:
path: ${{ runner.workspace }}/build
key: android-build-${{ github.sha }}
build_app:
runs-on: ubuntu-latest
needs: [configure]
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: ${{env.JAVA_DISTRIBUTION}}
java-version: ${{env.JAVA_VERSION}}
- name: Setup Android SDK
uses: android-actions/setup-android@v2.0.10
- name: Setup Android NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: ${{env.NDK_VERSION}}
- uses: actions/cache/restore@v4
id: cache-restore
with:
path: ${{ runner.workspace }}/build
key: android-build-${{ github.sha }}
- name: Configure If Cache Missed
if: steps.cache-restore.outputs.cache-hit != 'true'
run: cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_TARGET_ANDROID=ON -DYUP_ENABLE_EXAMPLES=ON
- working-directory: ${{ runner.workspace }}/build/examples/app
run: ./gradlew assembleDebug
- working-directory: ${{ runner.workspace }}/build/examples/app
run: ./gradlew assemble
build_graphics:
runs-on: ubuntu-latest
needs: [configure]
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: ${{env.JAVA_DISTRIBUTION}}
java-version: ${{env.JAVA_VERSION}}
- name: Setup Android SDK
uses: android-actions/setup-android@v2.0.10
- name: Setup Android NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: ${{env.NDK_VERSION}}
- uses: actions/cache/restore@v4
id: cache-restore
with:
path: ${{ runner.workspace }}/build
key: android-build-${{ github.sha }}
- name: Configure If Cache Missed
if: steps.cache-restore.outputs.cache-hit != 'true'
run: cmake ${{ github.workspace }} -G "Ninja Multi-Config" -B ${{ runner.workspace }}/build -DYUP_TARGET_ANDROID=ON -DYUP_ENABLE_EXAMPLES=ON
- working-directory: ${{ runner.workspace }}/build/examples/graphics
run: ./gradlew assembleDebug
- working-directory: ${{ runner.workspace }}/build/examples/graphics
run: ./gradlew assemble