Assorted set of fixes (#38) #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected] | |
- name: Setup Android NDK | |
uses: nttld/setup-ndk@v1 | |
with: | |
ndk-version: ${{env.NDK_VERSION}} | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{runner.workspace}}/build | |
- name: Configure | |
working-directory: ${{runner.workspace}}/build | |
run: cmake $GITHUB_WORKSPACE -G "Ninja Multi-Config" -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/[email protected] | |
- name: Setup Android NDK | |
uses: nttld/setup-ndk@v1 | |
with: | |
ndk-version: ${{env.NDK_VERSION}} | |
- uses: actions/cache/restore@v4 | |
with: | |
path: ${{runner.workspace}}/build | |
key: android-build-${{ github.sha }} | |
- 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/[email protected] | |
- name: Setup Android NDK | |
uses: nttld/setup-ndk@v1 | |
with: | |
ndk-version: ${{env.NDK_VERSION}} | |
- uses: actions/cache/restore@v4 | |
with: | |
path: ${{runner.workspace}}/build | |
key: android-build-${{ github.sha }} | |
- working-directory: ${{runner.workspace}}/build/examples/graphics | |
run: ./gradlew assembleDebug | |
- working-directory: ${{runner.workspace}}/build/examples/graphics | |
run: ./gradlew assemble | |
build_render: | |
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: 'temurin' | |
java-version: 17 | |
- name: Setup Android SDK | |
uses: android-actions/[email protected] | |
- name: Setup Android NDK | |
uses: nttld/setup-ndk@v1 | |
with: | |
ndk-version: r26d | |
- uses: actions/cache/restore@v4 | |
with: | |
path: ${{runner.workspace}}/build | |
key: android-build-${{ github.sha }} | |
- working-directory: ${{runner.workspace}}/build/examples/render | |
run: ./gradlew assembleDebug | |
- working-directory: ${{runner.workspace}}/build/examples/render | |
run: ./gradlew assemble |