From 6bb6be300bb262f18b7c80af2903718bde38e8fd Mon Sep 17 00:00:00 2001 From: KTC-YoheiMiyashita Date: Mon, 23 Dec 2024 15:11:40 +0900 Subject: [PATCH] codecov --- .github/workflows/build.yml | 26 ++++++++++++++++++++++++-- README.md | 1 + dbAndCsvBatch/build.gradle | 8 ++++++++ skeletonBatch/build.gradle | 8 ++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed62d00..07931eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,8 +50,30 @@ jobs: distribution: 'temurin' java-version: '21' - - name: Generate jOOQ Classes and Build - run: ./gradlew clean generateJooq build --info --stacktrace + - name: Build skeletonBatch + run: | + cd skeletonBatch + ../gradlew clean generateJooq build jacocoTestReport --info --stacktrace + + - name: Build dbAndCsvBatch + run: | + cd dbAndCsvBatch + ../gradlew clean generateJooq build jacocoTestReport --info --stacktrace + + - name: Upload coverage to Codecov for skeletonBatch + uses: codecov/codecov-action@v4 + with: + files: skeletonBatch/build/reports/jacoco/test/jacocoTestReport.xml + + - name: Upload coverage to Codecov for dbAndCsvBatch + uses: codecov/codecov-action@v4 + with: + files: dbAndCsvBatch/build/reports/jacoco/test/jacocoTestReport.xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: ./*/build/reports/jacoco/test/jacocoTestReport.xml - name: Archive Test Reports if: always() diff --git a/README.md b/README.md index 9a266b2..c67ff01 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![GitHub stars](https://img.shields.io/github/stars/KTC-YoheiMiyashita/SpringBoot3BatchStarter?style=social)](https://github.com/KTC-YoheiMiyashita/SpringBoot3BatchStarter/stargazers) [![Build](https://github.com/kinto-technologies/SpringBoot3BatchStarter/actions/workflows/build.yml/badge.svg)](https://github.com/kinto-technologies/SpringBoot3BatchStarter/actions/workflows/build.yml) +![Codecov](https://img.shields.io/codecov/c/github/kinto-technologies/SpringBoot3BatchStarter?style=flat) ![Java 21](https://img.shields.io/badge/Java-21%2B-blue) [![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-CC2233.svg)](https://opensource.org/licenses/Apache-2.0) diff --git a/dbAndCsvBatch/build.gradle b/dbAndCsvBatch/build.gradle index 03e49d1..e5b2bf0 100644 --- a/dbAndCsvBatch/build.gradle +++ b/dbAndCsvBatch/build.gradle @@ -60,6 +60,14 @@ tasks.withType(Test).configureEach { useJUnitPlatform() } +jacocoTestReport { + reports { + xml.required = true + csv.required = true + html.outputLocation = layout.buildDirectory.dir('jacocoHtml') + } +} + // https://github.com/diffplug/spotless spotless { java { diff --git a/skeletonBatch/build.gradle b/skeletonBatch/build.gradle index fe67078..acd6785 100644 --- a/skeletonBatch/build.gradle +++ b/skeletonBatch/build.gradle @@ -43,6 +43,14 @@ tasks.withType(Test).configureEach { useJUnitPlatform() } +jacocoTestReport { + reports { + xml.required = true + csv.required = true + html.outputLocation = layout.buildDirectory.dir('jacocoHtml') + } +} + // https://github.com/diffplug/spotless spotless { java {