-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.29 KB
/
sonar.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: 소나클라우드 분석
on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
types: [opened, synchronize, reopened]
jobs:
build:
name: 빌드 및 분석
runs-on: ubuntu-latest
services:
redis:
image: redis:7.4.2 # Redis 컨테이너 추가
ports:
- 6379:6379
steps:
- uses: actions/checkout@v4
with:
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