-
Notifications
You must be signed in to change notification settings - Fork 2
[refactor/#369] sonarcloud 작동 확인 #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yongjun0511
merged 21 commits into
develop
from
refactor/#369-refactor-sonarcloud-jacoco
Jul 4, 2025
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
403c9fe
[refactor/#369] build.gradle 수정
yongjun0511 04b215e
[feat/#369] sonarcloud 액션 추가
yongjun0511 80145ed
[feat/#369] ci/cd 파이프라인 분리
yongjun0511 b3d9c58
[chore/#369] 임시로 테스트 해제
yongjun0511 cf2dc76
[chore/#369] 임시로 테스트 해제
yongjun0511 e0a98e3
[chore/#369] properties 업데이트
yongjun0511 605221c
[feat/#369] JpaAuditingConfig 분리
yongjun0511 eeb9c5a
[feat/#369] @Disabled 해제
yongjun0511 747563d
[feat/#369] redis test 삭제
yongjun0511 0971b6c
[feat/#369] test support 추가
yongjun0511 2c59d57
[feat/#369] test 상속 구조 설정
yongjun0511 f07a89d
[chore/#369] 임시 주석 처리
yongjun0511 37362f9
[chore/#369] 임시 주석 처리
yongjun0511 f4481d1
[fix/#369] sonarcube 에러 수정
yongjun0511 fd96406
[chore/#369] 테스트 임시 주석 처리
yongjun0511 0456276
[chore/#369] 임시로 테스트 커버리지 완화
yongjun0511 b6c3cf8
[chore/#369] 오타 정정
yongjun0511 d9ef356
[chore/#369] 오타 정정
yongjun0511 58db3b2
[chore/#369] 오타 정정
yongjun0511 eb9d4a1
[feat/#369] 오타 정정
yongjun0511 4235f08
[feat/#369] 오타 정정
yongjun0511 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| name: CD Pipeline | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ develop ] | ||
|
|
||
| jobs: | ||
| cd: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Create application-secret.yml | ||
| run: | | ||
| mkdir -p ./temp_secret | ||
| echo "${{ secrets.APPLICATION_SECRET }}" > ./temp_secret/application-secret.yml | ||
| shell: bash | ||
|
|
||
| - name: Copy application-secret.yml to EC2 | ||
| uses: appleboy/[email protected] | ||
| with: | ||
| username: ubuntu | ||
| host: ${{ secrets.EC2_HOST }} | ||
| key: ${{ secrets.EC2_SSH_KEY }} | ||
| source: ./temp_secret/application-secret.yml | ||
| target: /home/ubuntu/secret/ | ||
|
|
||
| - name: Copy docker-compose.yml | ||
| uses: appleboy/[email protected] | ||
| with: | ||
| username: ubuntu | ||
| host: ${{ secrets.EC2_HOST }} | ||
| key: ${{ secrets.EC2_SSH_KEY }} | ||
| source: ./docker-compose.yml | ||
| target: /home/ubuntu/cicd/ | ||
|
|
||
| - name: Copy deploy.sh | ||
| uses: appleboy/[email protected] | ||
| with: | ||
| username: ubuntu | ||
| host: ${{ secrets.EC2_HOST }} | ||
| key: ${{ secrets.EC2_SSH_KEY }} | ||
| source: ./deploy.sh | ||
| target: /home/ubuntu/cicd/ | ||
|
|
||
| - name: Deploy (Blue-Green) | ||
| uses: appleboy/ssh-action@master | ||
| with: | ||
| username: ubuntu | ||
| host: ${{ secrets.EC2_HOST }} | ||
| key: ${{ secrets.EC2_SSH_KEY }} | ||
| script: | | ||
| echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin | ||
| docker pull ${{ secrets.DOCKERHUB_USERNAME }}/clokey-docker:1.0.0 | ||
| sudo chmod +x /home/ubuntu/cicd/deploy.sh | ||
| sudo /home/ubuntu/cicd/deploy.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| name: CI Pipeline | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ develop ] | ||
|
|
||
| jobs: | ||
| ci: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Gradle Cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.gradle/caches | ||
| ~/.gradle/wrapper | ||
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
| restore-keys: ${{ runner.os }}-gradle- | ||
|
|
||
| - name: SonarCloud Cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.sonar/cache | ||
| key: ${{ runner.os }}-sonar | ||
| restore-keys: ${{ runner.os }}-sonar | ||
|
|
||
| - name: Run Tests + SonarCloud | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| run: ./gradlew test jacocoTestReport sonarqube --info --stacktrace | ||
|
|
||
| - name: Grant gradlew permission | ||
| run: chmod +x ./gradlew | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| with: | ||
| install: true | ||
|
|
||
| - name: Create buildx builder | ||
| run: | | ||
| docker buildx create --use --name mybuilder | ||
| docker buildx inspect --bootstrap | ||
|
|
||
| - name: Log in to DockerHub | ||
| uses: docker/login-action@v2 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Build & Push Dependency Cache | ||
| run: | | ||
| docker buildx build \ | ||
| --builder mybuilder \ | ||
| --platform linux/amd64 \ | ||
| --push \ | ||
| --file Dockerfile \ | ||
| --tag ${{ secrets.DOCKERHUB_USERNAME }}/clokey-docker:dependency-cache \ | ||
| --cache-to type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/clokey-docker:dependency-cache,mode=max \ | ||
| . | ||
|
|
||
| - name: Build & Push App Image | ||
| run: | | ||
| docker buildx build \ | ||
| --builder mybuilder \ | ||
| --platform linux/amd64 \ | ||
| --push \ | ||
| --file Dockerfile \ | ||
| --tag ${{ secrets.DOCKERHUB_USERNAME }}/clokey-docker:1.0.0 \ | ||
| --build-arg DEPENDENCY_IMAGE=${{ secrets.DOCKERHUB_USERNAME }}/clokey-docker:dependency-cache \ | ||
| --cache-from type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/clokey-docker:dependency-cache \ | ||
| . |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,4 +168,5 @@ public void releaseBan(){ | |
| this.banned = false; | ||
| } | ||
|
|
||
|
|
||
| } | ||
9 changes: 9 additions & 0 deletions
9
src/main/java/com/clokey/server/global/config/JpaAuditingConfig.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.clokey.server.global.config; | ||
|
|
||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.data.jpa.repository.config.EnableJpaAuditing; | ||
|
|
||
| @Configuration | ||
| @EnableJpaAuditing | ||
| public class JpaAuditingConfig { | ||
| } |
14 changes: 14 additions & 0 deletions
14
src/test/java/com/clokey/server/domain/JpaIntegrationTestSupport.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package com.clokey.server.domain; | ||
|
|
||
| import com.clokey.server.global.config.QuerydslConfig; | ||
| import org.junit.jupiter.api.Disabled; | ||
| import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||
| import org.springframework.context.annotation.Import; | ||
| import org.springframework.test.context.ActiveProfiles; | ||
|
|
||
| @Disabled | ||
| @DataJpaTest | ||
| @ActiveProfiles("test") | ||
| @Import(QuerydslConfig.class) | ||
| public abstract class JpaIntegrationTestSupport { | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
따로 뺀 이유가 뭔가요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repository layer에서 @DataJpaTest를 수행하는데, 전체 Context를 로딩하지 않아서 createdAt과 updatedAt을 업데이트 할 때 에러가 생겨서 따로 config로 빼주었슴다.