name: Tests

on: [ push, pull_request ]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: true
      matrix:
        os: [ ubuntu-latest ]
        java: [ 8, 9, 10, 11 ]

    name: Java v${{ matrix.java }} - ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v2
      - name: Set up Java
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
          architecture: x64
      - name: Cache Gradle packages
          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: Run tests
        run: ./gradlew test
      - name: Cleanup Gradle Cache
          # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
          # Restoring these files from a GitHub Actions cache might cause problems for future builds.
          run: |
            rm -f ~/.gradle/caches/modules-2/modules-2.lock
            rm -f ~/.gradle/caches/modules-2/gc.properties

Create github workflow to run Gradle tests
Create github workflow to run Gradle tests

