Skip to content

Commit

Permalink
Update sonar.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
leeys9423 authored Feb 19, 2025
1 parent 2b194f3 commit a445542
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,49 @@ on:
pull_request:
branches: [ dev ]
types: [opened, synchronize, reopened]

jobs:
build:
name: 빌드 및 분석
runs-on: ubuntu-latest

services:
redis:
image: redis:7.4.2 # Redis 컨테이너 추가
image: redis:7.4.2
ports:
- 6379:6379

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # 더 정확한 분석을 위해 전체 커밋 히스토리 가져오기

fetch-depth: 0
- name: JDK 17 설정
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: SonarCloud 패키지 캐시
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Gradle 패키지 캐시
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: 빌드 및 분석 실행
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build jacocoTestReport sonar --info
run: ./gradlew build jacocoTestReport sonar --info --stacktrace

# 테스트 결과 저장 (테스트 실패해도 실행)
- name: 테스트 결과 저장
if: always()
uses: actions/upload-artifact@v2
with:
name: test-results
path: |
build/reports/tests/test/
build/reports/jacoco/test/html/

0 comments on commit a445542

Please sign in to comment.