Skip to content

Commit

Permalink
Refine code coverage settings
Browse files Browse the repository at this point in the history
  • Loading branch information
hayarobi committed Oct 7, 2024
1 parent 4186274 commit 38b2b69
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 26 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ jobs:
submodules: 'recursive'

- name: Set up JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '8'
java-version: '17'
distribution: 'temurin'

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
with:
arguments: build allcoverage

# run unit test with code coverage report if action is triggered by push of master branch
# since Code Climate only evaluate code coverages of default branch.
- name: Unit Tests with publishing code coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{github.workspace}}/build/reports/jacoco/report.xml # optional
files: ${{github.workspace}}/report/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![LoC](https://tokei.rs/b1/github/aergoio/heraj)](https://github.com/aergoio/heraj)
[![github build](https://github.com/aergoio/heraj/actions/workflows/gradle.yml/badge.svg)](https://github.com/aergoio/aergo/actions/workflows/gradle.yml/badge.svg)
[![codecov.io](http://codecov.io/github/aergoio/heraj/coverage.svg?branch=develop)](http://codecov.io/github/aergoio/heraj?branch=develop)
[![codecov.io](https://codecov.io/github/aergoio/heraj/coverage.svg?branch=develop)](https://codecov.io/github/aergoio/heraj?branch=develop)

The hera is the client-side framework for the aergo.
This repository, heraj is java implementation for hera.
Expand Down
25 changes: 5 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,11 @@ project(":") {
javadoc.enabled = false
sourceJar.enabled = false

// task allcoverage(type: JacocoReport) {
// def targetProjects = javaLibraryProjects.findAll {
// it.name != 'annotation' && it.name != 'protobuf'
// }
// dependsOn = targetProjects.collect{it.getTasksByName('coverage',false)}
// getSourceDirectories().setFrom(targetProjects.sourceSets.main.allSource.srcDirs)
// getClassDirectories().setFrom(targetProjects.sourceSets.main.output.classesDirs)
// getExecutionData().setFrom(targetProjects.collect{it.getTasksByName('jacocoTestReport', false).executionData})
// reports {
// html.required = true
// xml.required = true
// xml.destination file("${buildDir}/reports/jacoco/report.xml")
// csv.required = false
// }
// afterEvaluate {
// getClassDirectories().setFrom(classDirectories.files.collect {
// fileTree(dir: it, exclude: ['types/**'])
// })
// }
// }
task allcoverage {
dependsOn ':report:testCodeCoverageReport'
group = 'verification'
description = 'Runs the testCodeCoverageReport task in the report submodule.'
}

task alljavadoc(type: Javadoc, group: 'Documentation') {
def targetProjects = javaLibraryProjects.findAll {
Expand Down

0 comments on commit 38b2b69

Please sign in to comment.