name: CI

on:
  push:
    branches:
      - '*'
  pull_request:
    branches:
      - '*'

# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/software-installed-on-github-hosted-runners

jobs:
  windows:
    name: 'Windows (JDK 14)'
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@v1.1.0
      with:
        fetch-depth: 50
    - name: 'Set up JDK 14'
      uses: actions/setup-java@v1
      with:
        java-version: 14
    - uses: burrunan/gradle-cache-action@v1
      name: Test
      with:
        job-id: jdk14
        multi-cache-enabled: false
        arguments: --scan --no-parallel build -x distTar -x distTarSource

  mac:
    name: 'macOS (JDK 14)'
    runs-on: macos-latest
    steps:
    - uses: actions/checkout@v1.1.0
      with:
        fetch-depth: 50
    - name: 'Set up JDK 14'
      uses: actions/setup-java@v1
      with:
        java-version: 14
    - uses: burrunan/gradle-cache-action@v1
      name: Test
      with:
        job-id: jdk14
        multi-cache-enabled: false
        arguments: --scan --no-parallel build -x distTar -x distTarSource -Dskip.test_TestDNSCacheManager.testWithCustomResolverAnd1Server=true

  errorprone:
    name: 'Error Prone (JDK 11)'
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 50
    - name: 'Set up JDK 11'
      uses: actions/setup-java@v1
      with:
        java-version: 11
    - uses: burrunan/gradle-cache-action@v1
      name: Test
      with:
        job-id: errprone
        multi-cache-enabled: false
        arguments: --scan --no-parallel --no-daemon -PenableErrorprone classes
