name: Java CI with Gradle
on: [push, pull_request]

jobs:
  build:
    name: Build JGiven on Java ${{ matrix.java }} with Junit ${{matrix.junit}}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [ '8', '11', '13']
        junit: [ '4.9', '4.13' ]
    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK ${{matrix.java}}
        uses: actions/setup-java@v2
        with:
          java-version: ${{matrix.java}}
          distribution: 'adopt'
      - name: Grant execute permission for gradlew
        run: chmod +x gradlew
      - name: Build with Gradle  and Junit ${{matrix.junit}}
        env:
          JUNIT_VERSION: ${{matrix.junit}}
        run:   "./gradlew -i -s check -DjunitVersion=${JUNIT_VERSION}"
      - name: Run Jacoco
        if: ${{matrix.java == '8' && github.ref == 'refs/heads/master' && github.head_ref == null}}
        run: ./gradlew overallJacocoReport coveralls
      - name: Upload test results html files
        uses: actions/upload-artifact@v2
        with:
          name: test-report ${{matrix.java}} ${{matrix.junit}}
          path: /home/runner/work/JGiven/JGiven/jgiven-tests/build/reports/tests

name: Java CI with Gradle
on: [push, pull_request]

jobs:
  build:
    name: Build JGiven on Java ${{ matrix.java }} with Junit ${{matrix.junit}}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [ '8', '11', '13']
        junit: [ '4.9', '4.13' ]
    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK ${{matrix.java}}
        uses: actions/setup-java@v2
        with:
          java-version: ${{matrix.java}}
          distribution: 'adopt'
      - name: Grant execute permission for gradlew
        run: chmod +x gradlew
      - name: Build with Gradle  and Junit ${{matrix.junit}}
        env:
          JUNIT_VERSION: ${{matrix.junit}}
        run:   "./gradlew -i -s check -DjunitVersion=${JUNIT_VERSION}"
      - name: Run Jacoco
        if: ${{matrix.java == '8' && github.ref == 'refs/heads/master' && github.head_ref == null}}
        run: ./gradlew overallJacocoReport coveralls
      - name: Upload test results html files
        uses: actions/upload-artifact@v2
        with:
          name: test-report_${{matrix.java}}_${{matrix.junit}}
          path: /home/runner/work/JGiven/JGiven/*/build/reports/tests
          if-no-files-found: ignore

Add all test folders to build folder and change name
Add all test folders to build folder and change name

Signed-off-by: Andru Stefanescu <7ddc31439e278e07060dec99cf8ddedbee60ab4a@cam.ac.uk>
