Build AAR and Robo (single platform) #408
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: Build AAR and Robo (single platform) | |
on: | |
workflow_dispatch: | |
push: | |
schedule: | |
- cron: "0 0 * * *" | |
pull_request: | |
env: | |
DEBUG: 1 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 80 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Fetch submodules | |
run: git submodule update --init | |
- name: Setup Ninja | |
uses: ashutoshvarma/setup-ninja@master | |
with: | |
version: 1.10.0 | |
# The action puts a relative path on the PATH 🙄 | |
- name: Make path absolute | |
run: echo $(pwd)/ninja_bin >> $GITHUB_PATH | |
- name: Configure JDK 1.11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "adopt" | |
java-version: "11" # minimum for Android API31 | |
- name: Install Android Command Line Tools | |
uses: android-actions/setup-android@v2 | |
- name: Install NDK | |
if: matrix.os != 'windows-latest' | |
run: .github/scripts/install_ndk.sh 22.0.7026061 | |
- name: Install NDK (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
Write-Host "NDK Install Started" | |
(. sdkmanager.bat --install "ndk;22.0.7026061" --sdk_root="$Env:ANDROID_SDK_ROOT") | out-null | |
Write-Host "NDK Install Completed" | |
- name: Rust Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-rust-debug-v5-${{ hashFiles('Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-rust-debug-v5 | |
${{ runner.os }}-rust-debug | |
- name: Anki cache (Unix) | |
uses: actions/cache@v3 | |
if: matrix.os != 'windows-latest' | |
with: | |
path: | | |
anki/out/node_modules | |
anki/out/rust | |
anki/out/extracted | |
key: ${{ runner.os }}-anki-v6-${{ hashFiles('Cargo.lock', 'anki/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-anki-v6 | |
${{ runner.os }}-anki | |
- name: Anki cache (Windows) | |
uses: actions/cache@v3 | |
if: matrix.os == 'windows-latest' | |
with: | |
path: | | |
anki/out/rust | |
anki/out/extracted | |
key: ${{ runner.os }}-anki-v6-${{ hashFiles('Cargo.lock', 'anki/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-anki-v6 | |
${{ runner.os }}-anki | |
- name: Build Android/X86_64 | |
if: matrix.os != 'windows-latest' | |
run: ./build-aar.sh | |
- name: Build Android/X86_64 (Win) | |
if: matrix.os == 'windows-latest' | |
run: ./build-aar.bat | |
- name: Check Rust (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: ./check-rust.sh | |
- name: Run tests (Mac) | |
uses: reactivecircus/android-emulator-runner@v2 | |
if: matrix.os == 'macos-latest' | |
timeout-minutes: 30 | |
with: | |
api-level: 21 | |
target: default | |
arch: x86_64 | |
profile: Nexus 6 | |
script: ./check-droid.sh | |
- name: Build Robolectric/X86_64 | |
if: matrix.os != 'windows-latest' | |
run: ./build-robo.sh | |
- name: Build Robolectric/X86_64 (Win) | |
if: matrix.os == 'windows-latest' | |
run: ./build-robo.bat | |
- name: Upload rsdroid AAR as artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: rsdroid-aar-${{ matrix.os }} | |
if-no-files-found: error | |
path: rsdroid/build/outputs/aar | |
- name: Upload rsdroid-robo JAR as artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: rsdroid-robo-${{ matrix.os }} | |
if-no-files-found: error | |
path: rsdroid-testing/build/libs |