Skip to content

Commit 719fef1

Browse files
authored
Merge pull request #13 from Visual-Regression-Tracker/coverage
coverage report added
2 parents 1edc909 + 35f9531 commit 719fef1

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

.github/workflows/gradle.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,20 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v2
19+
1920
- name: Set up JDK 1.8
2021
uses: actions/setup-java@v1
2122
with:
2223
java-version: 1.8
24+
2325
- name: Grant execute permission for gradlew
2426
run: chmod +x gradlew
27+
2528
- name: Build with Gradle
2629
run: ./gradlew build
30+
31+
- name: Generate coverage
32+
run: ./gradlew codeCoverageReport
33+
34+
- name: Codecov
35+
uses: codecov/[email protected]

build.gradle

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ group 'io.visual-regression-tracker.sdk-java'
22
version '3.1.0'
33

44
apply plugin: 'java'
5+
apply plugin: 'jacoco'
56
apply plugin: "io.freefair.lombok"
67
apply plugin: "com.github.johnrengelman.shadow"
78

@@ -34,4 +35,25 @@ dependencies {
3435

3536
test {
3637
useTestNG()
38+
finalizedBy jacocoTestReport // report is always generated after tests run
39+
}
40+
41+
// codecov integration https://github.com/codecov/example-gradle
42+
task codeCoverageReport(type: JacocoReport) {
43+
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
44+
45+
subprojects.each {
46+
sourceSets it.sourceSets.main
47+
}
48+
49+
reports {
50+
xml.enabled true
51+
xml.destination file("${buildDir}/reports/jacoco/report.xml")
52+
html.enabled false
53+
csv.enabled false
54+
}
55+
}
56+
57+
codeCoverageReport.dependsOn {
58+
subprojects*.test
3759
}

lombok.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# This file is generated by the 'io.freefair.lombok' Gradle plugin
22
config.stopBubbling = true
3+
lombok.addLombokGeneratedAnnotation = true

0 commit comments

Comments
 (0)