# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle

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

jobs:
  build:

    runs-on: ubuntu-latest
    env:
      working-directory: ./code/ingest
    strategy:
      matrix:
        java-version: [ 8, 11, 17 ]

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK
      uses: actions/setup-java@v1
      with:
        java-version: ${{ matrix.java-version }}
    - name: Grant execute permission for gradlew
      run: chmod +x gradlew
      working-directory: ${{env.working-directory}}
    - name: Build with Gradle
      run: ./gradlew jacocoTestReport
      working-directory: ${{env.working-directory}}
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1
      with:
          files: code/ingest/build/reports/jacoco/test/jacocoTestReport.xml
          fail_ci_if_error: true
          verbose: true

# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle

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

jobs:
  build:

    runs-on: ubuntu-latest
    env:
      working-directory: ./code/ingest

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 1.11
      uses: actions/setup-java@v1
      with:
        java-version: 1.11
    - name: Grant execute permission for gradlew
      run: chmod +x gradlew
      working-directory: ${{env.working-directory}}
    - name: Build with Gradle
      run: ./gradlew jacocoTestReport
      working-directory: ${{env.working-directory}}
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1
      with:
          files: code/ingest/build/reports/jacoco/test/jacocoTestReport.xml
          fail_ci_if_error: true
          verbose: true

Revert "Attempt to test on multiple JDK's (expect 17 to fail)"
Revert "Attempt to test on multiple JDK's (expect 17 to fail)"

This reverts commit 5dbf0ca8e0e389888f0700044343db80eefa1b96.
