name: Android

on:
  pull_request:
  push:

jobs:
  build:
    strategy:
      matrix:
        os: [ubuntu-latest]

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v1
      - uses: xmake-io/github-action-setup-xmake@v1
        with:
          xmake-version: branch@dev
          build-cache: true
          build-cache-key: 'Android'

      - name: Prepare
        run: |
          wget -q https://dl.google.com/android/repository/android-ndk-r21-linux-x86_64.zip
          unzip -q -o ./android-ndk-r21-linux-x86_64.zip

      - name: Tests
        run: |
          xmake f -p android --ndk=`pwd`/android-ndk-r21
          xmake

