name: Android CI

on:
  pull_request:
  push:
    branches:
    - 'master'
    - '4.**'
    - '5.**'

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1

    - name: set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8

    - name: Install NDK
      run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.0.6113669" --sdk_root=${ANDROID_SDK_ROOT}

    - name: Validate Gradle Wrapper
      uses: gradle/wrapper-validation-action@v1

    - name: Build with Gradle
      run: ./gradlew qa
