name: Android CI for builds

on:
  push:
    branches: [ develop, master ]
  pull_request:

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - name: Checkout Git repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Fetch Git tags
        run: git fetch --tags
      - name: set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Cache local Gradle repository
        uses: actions/cache@v2
        with:
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
          restore-keys: |
            ${{ runner.os }}-gradle-
      - name: Grant execute permission for gradlew
        run: chmod +x gradlew
      - name: Build with Gradle
        run: ./gradlew build
