From 04a8fce305422da50ec938eb95e87031d6ecb417 Mon Sep 17 00:00:00 2001 From: changui <122252160+changuii@users.noreply.github.com> Date: Fri, 12 Dec 2025 16:19:44 +0900 Subject: [PATCH 01/12] =?UTF-8?q?chore:=20jacoco=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/build.gradle b/build.gradle index 2eb6b76..bb374ee 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,6 @@ plugins { id 'java' + id 'jacoco' id 'org.springframework.boot' version '3.5.3' id 'io.spring.dependency-management' version '1.1.7' } @@ -7,6 +8,10 @@ plugins { group = 'com.daedan' version = '0.0.1-SNAPSHOT' +jacoco { + toolVersion = "0.8.14" +} + java { toolchain { languageVersion = JavaLanguageVersion.of(21) @@ -88,3 +93,18 @@ tasks.named('test') { springBoot { buildInfo() } + +test { + useJUnitPlatform() + finalizedBy jacocoTestReport +} + +jacocoTestReport { + dependsOn test + + reports { + html.required = true + xml.required = true + csv.required = false + } +} From f5d452e9c906c3a927091f006b8899e68628b914 Mon Sep 17 00:00:00 2001 From: changui <122252160+changuii@users.noreply.github.com> Date: Fri, 12 Dec 2025 16:25:45 +0900 Subject: [PATCH 02/12] =?UTF-8?q?chore:=20jacoco=20=EA=B2=B0=EA=B3=BC=20?= =?UTF-8?q?=EC=BD=94=EB=A9=98=ED=8A=B8=20=EB=B0=8F=20=EA=B2=B0=EA=B3=BC=20?= =?UTF-8?q?=EB=A6=AC=ED=8F=AC=ED=8A=B8=20html=20=EB=A7=81=ED=81=AC=20?= =?UTF-8?q?=EC=B6=9C=EB=A0=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9a1708..fb61a40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,3 +53,31 @@ jobs: check_name: '테스트 결과 🛠️' check_run_annotations: 'none' comment_mode: 'off' + + - name: Comment coverage on PR + uses: madrapps/jacoco-report@v1.6 + with: + paths: build/reports/jacoco/test/jacocoTestReport.xml + token: ${{ secrets.GITHUB_TOKEN }} + min-coverage-overall: 70 // 최소 커버리지 일단 사용 x + min-coverage-changed-files: 80 // 이번 PR에서 변경된 파일만 기준 최소 커버리지 일단 사용 x + + - name: Deploy HTML to gh-pages (per PR) + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: build/reports/jacoco/test/html + target-folder: coverage/pr-${{ github.event.pull_request.number }} + + - name: Comment HTML link + uses: actions/github-script@v7 + with: + script: | + const pr = context.payload.pull_request.number; + const url = `https://${context.repo.owner}.github.io/${context.repo.repo}/coverage/pr-${pr}/`; + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr, + body: `🧾 JaCoCo HTML: ${url}` + }) From e806eac639ca69b24a2a0835e1e472f722d7a614 Mon Sep 17 00:00:00 2001 From: changui <122252160+changuii@users.noreply.github.com> Date: Fri, 12 Dec 2025 16:27:53 +0900 Subject: [PATCH 03/12] =?UTF-8?q?chore:=20=EC=95=84=EC=A7=81=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EC=9D=B4=20=EC=A0=95=ED=95=B4=EC=A7=80=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EC=9D=80=20=EC=84=A4=EC=A0=95=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb61a40..8ed3a83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,8 +59,6 @@ jobs: with: paths: build/reports/jacoco/test/jacocoTestReport.xml token: ${{ secrets.GITHUB_TOKEN }} - min-coverage-overall: 70 // 최소 커버리지 일단 사용 x - min-coverage-changed-files: 80 // 이번 PR에서 변경된 파일만 기준 최소 커버리지 일단 사용 x - name: Deploy HTML to gh-pages (per PR) uses: JamesIves/github-pages-deploy-action@v4 From bee24854428c16b02ed324e80f3cb82f0d203a04 Mon Sep 17 00:00:00 2001 From: changui <122252160+changuii@users.noreply.github.com> Date: Fri, 12 Dec 2025 16:33:17 +0900 Subject: [PATCH 04/12] =?UTF-8?q?chore:=20CI=20content=20write=20=EA=B6=8C?= =?UTF-8?q?=ED=95=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ed3a83..9944cf9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: Run-PR-Test: runs-on: ubuntu-latest permissions: - contents: read + contents: write pull-requests: write checks: write From 19a727d21fa239c0a801e88244621de28023ee6b Mon Sep 17 00:00:00 2001 From: changui <122252160+changuii@users.noreply.github.com> Date: Mon, 15 Dec 2025 17:59:59 +0900 Subject: [PATCH 05/12] =?UTF-8?q?chore:=20sonarqube=20cloud=20=EC=97=B0?= =?UTF-8?q?=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 4 +++- build.gradle | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9944cf9..bef51da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,9 @@ jobs: echo "${{ secrets.FIREBASE_ADMINSDK_ACCOUNT_KEY }}" > src/main/resources/firebase/firebase-adminsdk-account.json - name: Run Gradle Test - run: ./gradlew clean test + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: ./gradlew clean test jacocoTestReport sonarqube - name: Publish Unit Test Results if: always() diff --git a/build.gradle b/build.gradle index bb374ee..b48b631 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java' id 'jacoco' + id "org.sonarqube" version "7.2.1.6560" id 'org.springframework.boot' version '3.5.3' id 'io.spring.dependency-management' version '1.1.7' } @@ -96,7 +97,6 @@ springBoot { test { useJUnitPlatform() - finalizedBy jacocoTestReport } jacocoTestReport { From eeab9544317e7947106a1a41abfa7a8ba3f33be4 Mon Sep 17 00:00:00 2001 From: changui <122252160+changuii@users.noreply.github.com> Date: Mon, 15 Dec 2025 18:09:21 +0900 Subject: [PATCH 06/12] =?UTF-8?q?chore:=20sonar=20task=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20organization=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80,=20github=20token=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 3 ++- build.gradle | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bef51da..00a2f77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,8 @@ jobs: - name: Run Gradle Test env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./gradlew clean test jacocoTestReport sonarqube + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./gradlew clean test jacocoTestReport sonar - name: Publish Unit Test Results if: always() diff --git a/build.gradle b/build.gradle index b48b631..04e5559 100644 --- a/build.gradle +++ b/build.gradle @@ -13,6 +13,12 @@ jacoco { toolVersion = "0.8.14" } +sonar { + properties { + property "sonar.organization", "festabook" + } +} + java { toolchain { languageVersion = JavaLanguageVersion.of(21) From e6f88734d4f4f0b025580804cd6dc6395f239dc8 Mon Sep 17 00:00:00 2001 From: changui <122252160+changuii@users.noreply.github.com> Date: Mon, 15 Dec 2025 18:15:58 +0900 Subject: [PATCH 07/12] =?UTF-8?q?chore:=20projectKey=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index 04e5559..ad923e8 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,7 @@ jacoco { sonar { properties { + property "sonar.projectKey", "festabook_backend" property "sonar.organization", "festabook" } } From 8c6bdb675f33045a80b1f925a42f0813535a2033 Mon Sep 17 00:00:00 2001 From: changui <122252160+changuii@users.noreply.github.com> Date: Mon, 15 Dec 2025 18:23:32 +0900 Subject: [PATCH 08/12] =?UTF-8?q?chore:=20sonarqube=20=EB=B2=84=EC=A0=84?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ad923e8..32397cd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java' id 'jacoco' - id "org.sonarqube" version "7.2.1.6560" + id "org.sonarqube" version "7.2.0.6526" id 'org.springframework.boot' version '3.5.3' id 'io.spring.dependency-management' version '1.1.7' } From 71352965376d449dd1e0fd53441874946d52d47e Mon Sep 17 00:00:00 2001 From: changui <122252160+changuii@users.noreply.github.com> Date: Mon, 15 Dec 2025 19:23:04 +0900 Subject: [PATCH 09/12] =?UTF-8?q?chore:=20github=20token=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00a2f77..7204182 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,6 @@ jobs: - name: Run Gradle Test env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./gradlew clean test jacocoTestReport sonar - name: Publish Unit Test Results From 6c8ebef0f1a31fa9037ca8fa54ea9f18cd480dc1 Mon Sep 17 00:00:00 2001 From: changui <122252160+changuii@users.noreply.github.com> Date: Mon, 15 Dec 2025 19:42:35 +0900 Subject: [PATCH 10/12] =?UTF-8?q?chore:=20sonar=20qube=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=ED=8C=A8=ED=82=A4=EC=A7=80=20=EC=BA=90=EC=8B=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7204182..7b6be65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,13 @@ jobs: java-version: '21' distribution: 'temurin' + - name: Cache SonarQube packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Gradle cache uses: actions/cache@v4 with: From fa591f6ea09648f699b49b9c842daf360eeb5898 Mon Sep 17 00:00:00 2001 From: changui <122252160+changuii@users.noreply.github.com> Date: Tue, 16 Dec 2025 15:57:51 +0900 Subject: [PATCH 11/12] =?UTF-8?q?chore:=20=EC=A0=84=EC=B2=B490,=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD100=20=EC=BB=A4=EB=B2=84=EB=A6=AC=EC=A7=80=20?= =?UTF-8?q?=EC=A1=B0=EA=B1=B4=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20github=20?= =?UTF-8?q?pages=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b6be65..20dc058 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,23 +68,5 @@ jobs: with: paths: build/reports/jacoco/test/jacocoTestReport.xml token: ${{ secrets.GITHUB_TOKEN }} - - - name: Deploy HTML to gh-pages (per PR) - uses: JamesIves/github-pages-deploy-action@v4 - with: - branch: gh-pages - folder: build/reports/jacoco/test/html - target-folder: coverage/pr-${{ github.event.pull_request.number }} - - - name: Comment HTML link - uses: actions/github-script@v7 - with: - script: | - const pr = context.payload.pull_request.number; - const url = `https://${context.repo.owner}.github.io/${context.repo.repo}/coverage/pr-${pr}/`; - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: pr, - body: `🧾 JaCoCo HTML: ${url}` - }) + min-coverage-overall: 90 + min-coverage-changed-files: 100 From 4087079ed1998c3dab63bede6fbf60dc426a99e5 Mon Sep 17 00:00:00 2001 From: changui <122252160+changuii@users.noreply.github.com> Date: Tue, 23 Dec 2025 11:04:03 +0900 Subject: [PATCH 12/12] =?UTF-8?q?chore:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=BB=A4=EB=B2=84=EB=A6=AC=EC=A7=80=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=A0=9C=EC=99=B8=ED=95=A0=20=ED=81=B4=EB=9E=98=EC=8A=A4=20?= =?UTF-8?q?=EB=AA=85=EC=8B=9C=20(config,=20aspect,=20logging,=20applicatio?= =?UTF-8?q?n)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.gradle b/build.gradle index 32397cd..8e84767 100644 --- a/build.gradle +++ b/build.gradle @@ -109,6 +109,17 @@ test { jacocoTestReport { dependsOn test + classDirectories.setFrom( + files(classDirectories.files.collect { + fileTree(dir: it, exclude: [ + "**/*Application*", + "**/*Config*", + "**/*Aspect*", + "**/*Logging*" + ]) + }) + ) + reports { html.required = true xml.required = true