title: How to get or parse coverage persentage of Jacoco report in GitHub Actions
body: <p>I have Spring Boot app it uses gradle for build and package. I have configured Jacoco plugin and generating report in my local as HTML. I want to include it in my GitHub build workflow so whenever build runs I want to upload/store that Jacoco generated html report in the branch in which build is running. Is it possible using GitHub Actions?</p>
  <p>Also once Jacoco build report is created want to extract final code coverage percentage of that build (this percentage is only for my defined coverage rule) and create a badge in the repository in which build is running.</p>
  <p><strong>EDIT</strong></p>
  <pre><code>test {
      finalizedBy jacocoTestReport // report is always generated after tests run
  }
  jacocoTestReport {
      dependsOn test // tests are required to run before generating the report
  }
  
  jacoco {
      toolVersion = &quot;0.8.6&quot;
      //reportsDirectory = file(&quot;$buildDir/report/&quot;)
  }
  
  
  jacocoTestReport {
      dependsOn test
      sourceSets sourceSets.main
      executionData fileTree(project.rootDir.absolutePath).include(&quot;**/build/jacoco/*.exec&quot;)
      reports {
          xml.enabled false
          csv.enabled true
          html.destination file(&quot;${buildDir}/reports/jacoco/Html&quot;)
          csv.destination file(&quot;${buildDir}/reports/jacoco/jacoco.csv&quot;)
      }
  }
  
  //Test coverage Rule to make sure code coverage is 100 %
  jacocoTestCoverageVerification {
      violationRules {
          rule {
              element = 'CLASS'
              limit {
                  counter = 'LINE'
                  value = 'COVEREDRATIO'
                  minimum = 1.0
              }
              excludes = [
                      'com.cicd.herokuautodeploy.model.*',
                      'com.cicd.herokuautodeploy.HerokuautodeployApplication',
                      'com.cicd.herokuautodeploy.it.*'
              ]
          }
      }
  }
  
  </code></pre>
  <p><strong>WorkFlow File</strong></p>
  <pre><code>
  # This workflow will build a Java project with Gradle whenever Pull and Merge request to main branch
  # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
  
  name: Build WorkFlow - Building and Validating Test Coverage
  
  on:
    pull_request:
      branches: [ main,dev ]
  
  jobs:
    build:
  
      runs-on: ubuntu-latest
  
      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
        - name: Build with Gradle
          run: ./gradlew build
  
        - name: Generate JaCoCo Badge
          id: jacoco
          uses: cicirello/jacoco-badge-generator@v2.0.1
  
        - name: Log coverage percentage
          run: |
                  echo &quot;coverage = ${{ steps.jacoco.outputs.coverage }}&quot;
                  echo &quot;branch coverage = ${{ steps.jacoco.outputs.branches }}&quot;
  
        - name: Commit the badge (if it changed)
          run: |
            if [[ `git status --porcelain` ]]; then
                    git config --global user.name 'UserName'
                    git config --global user.email 'useremail@gmail.com'
                    git add -A
                    git commit -m &quot;Autogenerated JaCoCo coverage badge&quot;
                    git push
            fi
  
        - name: Upload JaCoCo coverage report
          uses: actions/upload-artifact@v2
          with:
            name: jacoco-report
            path: reports/jacoco/
  </code></pre>
  <p><strong>Error</strong></p>
  <p>File &quot;/JacocoBadgeGenerator.py&quot;, line 88, in computeCoverage
  with open(filename, newline='') as csvfile :
  FileNotFoundError: [Errno 2] No such file or directory: 'target/site/jacoco/jacoco.csv'</p>