# 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: Unit tests

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

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 11
      uses: actions/setup-java@v1
      with:
        java-version: 11

    - name: Run unit tests 
      run: ./gradlew test

    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v2
      with:
        directory: ./build/reports/jacoco/test/
        env_vars: OS,JDK
        fail_ci_if_error: true
        files: ./jacocoTestReport.xml
        flags: unit
        name: codecov-umbrella
        path_to_write_report: ./coverage/codecov_report.txt
        verbose: true
      env: 
        OS: linux
        JDK: openjdk11

#    - name: Generate test reports and upload to codecov
#      run: | 
#        ./gradlew jacocoTestReport 
#        bash <(curl -s https://codecov.io/bash) -e JDK,OS -F unit -f build/reports/jacoco/test/jacocoTestReport.xml;
#      env: 
#        OS: linux
#        JDK: openjdk11


# 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: Unit tests

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

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 11
      uses: actions/setup-java@v1
      with:
        java-version: 11

    - name: Run unit tests 
      run: ./gradlew test

    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v2
      with:
        directory: ./build/reports/jacoco/test/
        env_vars: OS,JDK
        fail_ci_if_error: true
        files: ./jacocoTestReport.xml
        flags: unit
        name: codecov-umbrella
        path_to_write_report: ./coverage/codecov_report.txt
        verbose: true
      env: 
        OS: linux
        JDK: openjdk11

#    - name: Generate test reports and upload to codecov
#      run: | 
#        ./gradlew jacocoTestReport 
#        bash <(curl -s https://codecov.io/bash) -e JDK,OS -F unit -f build/reports/jacoco/test/jacocoTestReport.xml;
#      env: 
#        OS: linux
#        JDK: openjdk11


Switch unit test to codecov action
Switch unit test to codecov action
