on: [pull_request]

jobs:
  tests:
    name: Rosetta Tests
    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: Build with Gradle
      run: ./gradlew clean test integrationTests

  spotless:
    name: Code Style Check
    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: Code Style Check
        run: ./gradlew clean spotlessCheck
on: [pull_request]

jobs:
  tests-zulu:
    name: Rosetta Tests (Zulu JDK)
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Setup Zulu JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
        architecture: x64
    - name: Build and test with Gradle
      run: ./gradlew clean test integrationTests

  tests-adpotopenjdk:
    name: Rosetta Tests (AdoptOpenJDK 8)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: Fetch latest AdoptOpenJDK 8 (hotspot) built for linux"
        run: curl -L "https://api.adoptopenjdk.net/v2/binary/nightly/openjdk8?openjdk_impl=hotspot&arch=x64&release=latest&type=jdk&os=linux" -o ojdk8.tar.gz
      - name: Setup Latest AdoptOpenJDK 1.8
        uses: actions/setup-java@master
        with:
          version: 8
          architecture: x64
          jdkFile: ./ojdk8.tar.gz
      - name: Print java version
        run: java -version
      - name: Build and test with Gradle
        run: ./gradlew clean test integrationTests

  spotless:
    name: Code Style Check
    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: Code Style Check with Gradle and Spotless
        run: ./gradlew clean spotlessCheck
Add AdoptOpenJDK to github actions
Add AdoptOpenJDK to github actions
