From 19dcaf41ec37b62b9fc594258624dc3c0611d2e6 Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 08:23:19 +0900 Subject: [PATCH 01/16] =?UTF-8?q?fix:=20pull=20requset=EC=8B=9C=20comment?= =?UTF-8?q?=EA=B0=80=20=EC=9E=91=EC=84=B1=EB=90=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cicd.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 412b099..0cbf48d 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -11,7 +11,10 @@ name: CI/CD on: push: branches: [ "main" ] - + pull_request: + branches: + - main + permissions: contents: read From c7f985485f1257af571e1891fcbe0328f2117974 Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 08:26:50 +0900 Subject: [PATCH 02/16] =?UTF-8?q?comment:=20=EB=B0=B0=ED=8F=AC=20=EC=A4=91?= =?UTF-8?q?=EB=8B=A8=20=EC=A3=BC=EC=84=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cicd.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 0cbf48d..f5b326a 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -57,15 +57,15 @@ jobs: run: ./gradlew jib - # ssh로 접속해 재배포 - - name: Deploy - uses: appleboy/ssh-action@master - with: - host: ${{ secrets.REMOTE_IP }} - username: ${{ secrets.REMOTE_SSH_ID }} - key: ${{ secrets.REMOTE_SSH_KEY }} - port: ${{ secrets.REMOTE_SSH_PORT }} - script: | - cd docker - docker compose pull wanf - docker compose up -d wanf + # ssh로 접속해 재배포 (2024 . 01 . 06 배포 중단) + #- name: Deploy + # uses: appleboy/ssh-action@master + # with: + # host: ${{ secrets.REMOTE_IP }} + # username: ${{ secrets.REMOTE_SSH_ID }} + # key: ${{ secrets.REMOTE_SSH_KEY }} + # port: ${{ secrets.REMOTE_SSH_PORT }} + # script: | + # cd docker + # docker compose pull wanf + # docker compose up -d wanf From b02dacfddd5b79a578b060e7443f1c009752dad1 Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 08:32:34 +0900 Subject: [PATCH 03/16] =?UTF-8?q?feat:=20codecov=20token=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cicd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index f5b326a..cc6b811 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -46,6 +46,7 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v2 with: + token: ${{ secrets.CODECOV_TOKEN }} file: ./build/jacoco/index.xml # gradlew 파일 권한 지정 From 6284802877245815fb0b24cdd803b2c75f2f58e8 Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 08:36:16 +0900 Subject: [PATCH 04/16] =?UTF-8?q?fix:=20codecov=20=EB=B2=84=EC=A0=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cicd.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index cc6b811..5ca2b04 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -43,10 +43,10 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 - with: - token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} file: ./build/jacoco/index.xml # gradlew 파일 권한 지정 From 3bdda5fdfa9c6108b41c3213c1cf678822d6f0ca Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 08:41:43 +0900 Subject: [PATCH 05/16] =?UTF-8?q?feat:=20codecoverage.yml=EB=A1=9C=20?= =?UTF-8?q?=EC=B6=94=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cicd.yml | 9 --------- codecoverage.yml | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 codecoverage.yml diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 5ca2b04..c1d8964 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -11,9 +11,6 @@ name: CI/CD on: push: branches: [ "main" ] - pull_request: - branches: - - main permissions: contents: read @@ -43,12 +40,6 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - file: ./build/jacoco/index.xml - # gradlew 파일 권한 지정 - name: Grant execute permission for gradlew run: chmod +x gradlew diff --git a/codecoverage.yml b/codecoverage.yml new file mode 100644 index 0000000..e02c398 --- /dev/null +++ b/codecoverage.yml @@ -0,0 +1,37 @@ +name: Code Coverage + +on: + push: + branches: + - 'main' + pull_request: + branches: + - 'main' + +jobs: + code-coverage: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + # JDK 17 설정 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'oracle' + + # Gradle 설정 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + file: ./build/jacoco/index.xml \ No newline at end of file From 2a1fe4e44201ec4bbe53e4ea611aba6fd23a218b Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 08:43:14 +0900 Subject: [PATCH 06/16] =?UTF-8?q?refactor:=20git=20action=20workflow=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=9C=84=EC=B9=98=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codecoverage.yml => .github/workflows/codecoverage.yml | 0 .github/workflows/codecov.yml => codecov.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename codecoverage.yml => .github/workflows/codecoverage.yml (100%) rename .github/workflows/codecov.yml => codecov.yml (100%) diff --git a/codecoverage.yml b/.github/workflows/codecoverage.yml similarity index 100% rename from codecoverage.yml rename to .github/workflows/codecoverage.yml diff --git a/.github/workflows/codecov.yml b/codecov.yml similarity index 100% rename from .github/workflows/codecov.yml rename to codecov.yml From 6c88c71c094f853917a93c8de7c88ce94b860e84 Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 08:59:55 +0900 Subject: [PATCH 07/16] =?UTF-8?q?feat:=20test=20job=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codecoverage.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml index e02c398..d41b235 100644 --- a/.github/workflows/codecoverage.yml +++ b/.github/workflows/codecoverage.yml @@ -23,13 +23,15 @@ jobs: distribution: 'oracle' # Gradle 설정 - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - - - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + arguments: test + cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }} + - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: From dd624f680e53755d88790b3630b162cc5a244147 Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 09:04:40 +0900 Subject: [PATCH 08/16] =?UTF-8?q?fix:=20workflow=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codecoverage.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml index d41b235..ec97563 100644 --- a/.github/workflows/codecoverage.yml +++ b/.github/workflows/codecoverage.yml @@ -26,12 +26,6 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - with: - arguments: test - cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }} - - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: From 8b07d449ceb1866a31cf5a6fc2308a5260bf8a88 Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 09:39:21 +0900 Subject: [PATCH 09/16] =?UTF-8?q?fix:=20workflow=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codecoverage.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml index ec97563..a07781b 100644 --- a/.github/workflows/codecoverage.yml +++ b/.github/workflows/codecoverage.yml @@ -26,6 +26,9 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: test + run: ./gradlew test + - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: From b8867de41c7746c0bedc47142219e11de74b4739 Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 09:43:24 +0900 Subject: [PATCH 10/16] =?UTF-8?q?fix:=20workflow=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codecoverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml index a07781b..efa2dc8 100644 --- a/.github/workflows/codecoverage.yml +++ b/.github/workflows/codecoverage.yml @@ -31,6 +31,7 @@ jobs: - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 + if: always() env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} file: ./build/jacoco/index.xml \ No newline at end of file From b86900998753c265342621a567aa91d8fa92a7b8 Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 09:54:48 +0900 Subject: [PATCH 11/16] =?UTF-8?q?fix:=20workflow=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codecoverage.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml index efa2dc8..69bb878 100644 --- a/.github/workflows/codecoverage.yml +++ b/.github/workflows/codecoverage.yml @@ -26,9 +26,6 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - - name: test - run: ./gradlew test - - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 if: always() From 3d8f652674b9e222e2e7576ac956b8213998d144 Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 10:14:23 +0900 Subject: [PATCH 12/16] =?UTF-8?q?fix:=20workflow=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codecoverage.yml | 3 +++ build.gradle | 1 + src/test/resources/application.yml | 12 ++++++------ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml index 69bb878..efa2dc8 100644 --- a/.github/workflows/codecoverage.yml +++ b/.github/workflows/codecoverage.yml @@ -26,6 +26,9 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: test + run: ./gradlew test + - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 if: always() diff --git a/build.gradle b/build.gradle index ed99fdf..194b399 100644 --- a/build.gradle +++ b/build.gradle @@ -70,6 +70,7 @@ jacoco { test { useJUnitPlatform() finalizedBy 'jacocoTestReport' + exclude '**/*Controller*', '**/*Application*', '**/ProfileRepositoryTest*' jacoco { excludes += ["com/capstone/wanf/error", diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index 15d52c9..9c03110 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -20,8 +20,8 @@ spring: default-encoding: UTF-8 host: smtp.gmail.com port: 587 - username: ${GOOGLE_MAIL} - password: ${GOOGLE_PASSWORD} + username: google email + password: google password properties: mail: smtp: @@ -32,11 +32,11 @@ spring: trust: smtp.gmail.com kafka: producer: - bootstrap-servers: ${KAFKA_HOST}:${KAFKA_PORT} + bootstrap-servers: localhost:9092 key-serializer: org.apache.kafka.common.serialization.StringSerializer value-serializer: org.springframework.kafka.support.serializer.JsonSerializer consumer: - bootstrap-servers: ${KAFKA_HOST}:${KAFKA_PORT} + bootstrap-servers: localhost:9092 group-id: wanf auto-offset-reset: earliest key-deserializer: org.apache.kafka.common.serialization.StringDeserializer @@ -65,8 +65,8 @@ cors: cloud: aws: credentials: - access-key: ${AWS_ACCESS_KEY} - secret-key: ${AWS_SECRET_KEY} + access-key: aws access key + secret-key: aws secret key region: static: ap-northeast-2 s3: From 46ac0b5192c47eeeec14fc1cae435aacdc92c44c Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 10:24:17 +0900 Subject: [PATCH 13/16] =?UTF-8?q?fix:=20workflow=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codecoverage.yml | 16 +++++++++++----- build.gradle | 3 +-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml index efa2dc8..bcfdc6c 100644 --- a/.github/workflows/codecoverage.yml +++ b/.github/workflows/codecoverage.yml @@ -2,12 +2,14 @@ name: Code Coverage on: push: - branches: - - 'main' + branches: [ '*' ] pull_request: branches: - 'main' +permissions: + contents: read + jobs: code-coverage: runs-on: ubuntu-latest @@ -23,8 +25,10 @@ jobs: distribution: 'oracle' # Gradle 설정 - - name: Grant execute permission for gradlew - run: chmod +x gradlew + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/dev' }} - name: test run: ./gradlew test @@ -34,4 +38,6 @@ jobs: if: always() env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - file: ./build/jacoco/index.xml \ No newline at end of file + directory: ./build/jacoco + fail_ci_if_error: true + continue-on-error: true \ No newline at end of file diff --git a/build.gradle b/build.gradle index 194b399..c5f518e 100644 --- a/build.gradle +++ b/build.gradle @@ -96,11 +96,10 @@ bootBuildImage { jacocoTestReport { reports { xml.enabled true - csv.enabled true + csv.enabled false html.enabled true xml.destination file("${buildDir}/jacoco/index.xml") - csv.destination file("${buildDir}/jacoco/index.csv") html.destination file("${buildDir}/jacoco/index.html") } From 87c7f0ca489936a314bf626b03f5ea7a35b7b5a9 Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 10:25:47 +0900 Subject: [PATCH 14/16] =?UTF-8?q?fix:=20workflow=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codecoverage.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml index bcfdc6c..9711021 100644 --- a/.github/workflows/codecoverage.yml +++ b/.github/workflows/codecoverage.yml @@ -24,12 +24,17 @@ jobs: java-version: '17' distribution: 'oracle' + # Gradle 설정 - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: cache-read-only: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/dev' }} + # gradlew 파일 권한 지정 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: test run: ./gradlew test From 766b3b827bc39025a6432f67e2ff74665311c8c4 Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 10:31:06 +0900 Subject: [PATCH 15/16] =?UTF-8?q?fix:=20workflow=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codecoverage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml index 9711021..9941bb8 100644 --- a/.github/workflows/codecoverage.yml +++ b/.github/workflows/codecoverage.yml @@ -42,7 +42,7 @@ jobs: uses: codecov/codecov-action@v3 if: always() env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - directory: ./build/jacoco + token: ${{ secrets.CODECOV_TOKEN }} + file: ./build/jacoco/index.xml fail_ci_if_error: true continue-on-error: true \ No newline at end of file From 54f176a83f04f82718784dce58047480e8e29459 Mon Sep 17 00:00:00 2001 From: hongyoung Date: Sat, 6 Jan 2024 10:36:39 +0900 Subject: [PATCH 16/16] =?UTF-8?q?fix:=20workflow=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codecoverage.yml | 2 +- build.gradle | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml index 9941bb8..ae5e175 100644 --- a/.github/workflows/codecoverage.yml +++ b/.github/workflows/codecoverage.yml @@ -43,6 +43,6 @@ jobs: if: always() env: token: ${{ secrets.CODECOV_TOKEN }} - file: ./build/jacoco/index.xml + file: ./build/reports/jacoco/test/jacocoTestReport.xml fail_ci_if_error: true continue-on-error: true \ No newline at end of file diff --git a/build.gradle b/build.gradle index c5f518e..6cbad1e 100644 --- a/build.gradle +++ b/build.gradle @@ -99,8 +99,8 @@ jacocoTestReport { csv.enabled false html.enabled true - xml.destination file("${buildDir}/jacoco/index.xml") - html.destination file("${buildDir}/jacoco/index.html") + xml.destination file("${buildDir}/reports/jacoco/test/jacocoTestReport.xml") + html.destination file("${buildDir}/reports/jacoco/test/jacocoTestReport.html") } finalizedBy 'jacocoTestCoverageVerification'