-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (137 loc) · 3.86 KB
/
ci.yml
File metadata and controls
155 lines (137 loc) · 3.86 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Backend CI
on:
pull_request:
branches:
- developV2
jobs:
build-test:
name: Build & Test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: devpick_test
POSTGRES_USER: devpick
POSTGRES_PASSWORD: devpick
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Java 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build & Test
run: ./gradlew build --no-daemon
env:
SPRING_PROFILES_ACTIVE: test
DB_HOST: localhost
DB_PORT: 5432
DB_NAME: devpick_test
DB_USERNAME: devpick
DB_PASSWORD: devpick
REDIS_HOST: localhost
REDIS_PORT: 6379
AWS_REGION: us-east-1
JWT_SECRET: ${{ secrets.JWT_SECRET_TEST }}
RESEND_API_KEY: test-api-key
- name: Upload test results
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-results
path: build/reports/tests/
- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: build-artifacts
path: |
build/classes/
build/reports/jacoco/
sonar:
name: SonarCloud Quality Gate
# SonarCloud Free는 커스텀 Quality Gate 할당 불가 → Sonar way(80%) 유지.
# PR 블로킹 완화: 분석은 업로드하되 QG 실패로 워크플로 전체를 실패시키지 않음.
continue-on-error: true
runs-on: ubuntu-latest
needs: build-test
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: devpick_test
POSTGRES_USER: devpick
POSTGRES_PASSWORD: devpick
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Java 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: build/
- name: SonarCloud Scan
run: ./gradlew sonar --no-daemon -Dsonar.qualitygate.wait=false
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SPRING_PROFILES_ACTIVE: test
DB_HOST: localhost
DB_PORT: 5432
DB_NAME: devpick_test
DB_USERNAME: devpick
DB_PASSWORD: devpick
REDIS_HOST: localhost
REDIS_PORT: 6379
AWS_REGION: us-east-1
JWT_SECRET: ${{ secrets.JWT_SECRET_TEST }}
RESEND_API_KEY: test-api-key