From 542efe237895ae81d8f6723d5a0825396355078e Mon Sep 17 00:00:00 2001 From: Pavel Strunkin Date: Fri, 24 Jul 2020 17:28:07 +0200 Subject: [PATCH 1/7] coverage report added --- .github/workflows/gradle.yml | 6 ++++++ build.gradle | 2 ++ lombok.config | 1 + 3 files changed, 9 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 58e1c59..4dbc740 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -16,11 +16,17 @@ jobs: steps: - uses: actions/checkout@v2 + - - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 + - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Build with Gradle run: ./gradlew build + + - name: Codacy Coverage Reporter + uses: codacy/codacy-coverage-reporter-action@0.2.0 \ No newline at end of file diff --git a/build.gradle b/build.gradle index 16d98b7..c5b2cff 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ group 'io.visual-regression-tracker.sdk-java' version '3.1.0' apply plugin: 'java' +apply plugin: 'jacoco' apply plugin: "io.freefair.lombok" apply plugin: "com.github.johnrengelman.shadow" @@ -34,4 +35,5 @@ dependencies { test { useTestNG() + finalizedBy jacocoTestReport // report is always generated after tests run } \ No newline at end of file diff --git a/lombok.config b/lombok.config index 6aa51d7..189c0be 100644 --- a/lombok.config +++ b/lombok.config @@ -1,2 +1,3 @@ # This file is generated by the 'io.freefair.lombok' Gradle plugin config.stopBubbling = true +lombok.addLombokGeneratedAnnotation = true From 74c4b575687b6c440bdc9d139ce06a1aac8b7de4 Mon Sep 17 00:00:00 2001 From: Pavel Strunkin Date: Fri, 24 Jul 2020 17:30:02 +0200 Subject: [PATCH 2/7] Update gradle.yml --- .github/workflows/gradle.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 4dbc740..9766bb3 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v2 - - + - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: @@ -29,4 +29,4 @@ jobs: run: ./gradlew build - name: Codacy Coverage Reporter - uses: codacy/codacy-coverage-reporter-action@0.2.0 \ No newline at end of file + uses: codacy/codacy-coverage-reporter-action@0.2.0 From 78167a96c884c017a0d3a7a1a059de7eefc11d01 Mon Sep 17 00:00:00 2001 From: Pavel Strunkin Date: Fri, 24 Jul 2020 21:31:50 +0200 Subject: [PATCH 3/7] Update gradle.yml --- .github/workflows/gradle.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 9766bb3..a791b89 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -30,3 +30,5 @@ jobs: - name: Codacy Coverage Reporter uses: codacy/codacy-coverage-reporter-action@0.2.0 + with: + project-token: ${{secret.CODACY_TOKEN}} From 1471eda6b30ae25eb3ede3a5eebf9634411e7707 Mon Sep 17 00:00:00 2001 From: Pavel Strunkin Date: Fri, 24 Jul 2020 21:35:38 +0200 Subject: [PATCH 4/7] Update gradle.yml --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index a791b89..1323a61 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -31,4 +31,4 @@ jobs: - name: Codacy Coverage Reporter uses: codacy/codacy-coverage-reporter-action@0.2.0 with: - project-token: ${{secret.CODACY_TOKEN}} + project-token: ${{ secrets.CODACY_TOKEN }} From 6d07941864fe0fc15fbb2fe14106057f7b1493bb Mon Sep 17 00:00:00 2001 From: Pavel Strunkin Date: Fri, 24 Jul 2020 21:41:48 +0200 Subject: [PATCH 5/7] Update gradle.yml --- .github/workflows/gradle.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 1323a61..dcaf055 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -28,7 +28,5 @@ jobs: - name: Build with Gradle run: ./gradlew build - - name: Codacy Coverage Reporter - uses: codacy/codacy-coverage-reporter-action@0.2.0 - with: - project-token: ${{ secrets.CODACY_TOKEN }} + - name: Codecov + uses: codecov/codecov-action@v1.0.12 From cd25a63b20cc3debe759234e7c292e8583090080 Mon Sep 17 00:00:00 2001 From: Pavel Strunkin Date: Fri, 24 Jul 2020 21:49:45 +0200 Subject: [PATCH 6/7] codecov integration --- build.gradle | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/build.gradle b/build.gradle index c5b2cff..e5287da 100644 --- a/build.gradle +++ b/build.gradle @@ -36,4 +36,24 @@ dependencies { test { useTestNG() finalizedBy jacocoTestReport // report is always generated after tests run +} + +// codecov integration https://github.com/codecov/example-gradle +task codeCoverageReport(type: JacocoReport) { + executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec") + + subprojects.each { + sourceSets it.sourceSets.main + } + + reports { + xml.enabled true + xml.destination file("${buildDir}/reports/jacoco/report.xml") + html.enabled false + csv.enabled false + } +} + +codeCoverageReport.dependsOn { + subprojects*.test } \ No newline at end of file From 35f953185a88b097bc054839fe9e3842b54c46e9 Mon Sep 17 00:00:00 2001 From: Pavel Strunkin Date: Fri, 24 Jul 2020 21:51:41 +0200 Subject: [PATCH 7/7] Update gradle.yml --- .github/workflows/gradle.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index dcaf055..6fc94d3 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -27,6 +27,9 @@ jobs: - name: Build with Gradle run: ./gradlew build + + - name: Generate coverage + run: ./gradlew codeCoverageReport - name: Codecov uses: codecov/codecov-action@v1.0.12