-
Notifications
You must be signed in to change notification settings - Fork 1
178 lines (158 loc) · 5.05 KB
/
Copy pathpr-check.yml
File metadata and controls
178 lines (158 loc) · 5.05 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: PR Check
on:
pull_request:
branches: [ dev, main ]
jobs:
build-and-test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: test_db
MYSQL_USER: test_user
MYSQL_PASSWORD: test
MYSQL_ROOT_PASSWORD: test_root
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -ptest_root"
--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
rabbitmq:
image: rabbitmq:3-management
ports:
- 5672:5672
- 15672:15672
options: >-
--health-cmd="rabbitmq-diagnostics -q ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
SPRING_PROFILES_ACTIVE: dev
# Database
DATASOURCE_URL: jdbc:mysql://127.0.0.1:3306/test_db?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Seoul
MYSQL_USER: test_user
MYSQL_PASSWORD: test
DATASOURCE_DRIVER_CLASS_NAME: com.mysql.cj.jdbc.Driver
JPA_DDL_OPTION: create
JPA_HIBERNATE_DIALECT: org.hibernate.dialect.MySQLDialect
# JWT
JWT_SECRET: pPmJ9ViYt8f6HAh2q5s36QmEUeyEFRcquPaNpnIGUK8er5DjfTKa4xbDsTFXQ7HRVfTLR2DIYs7s9iGdJ+Yb7Q==
JWT_ACCESS_EXPIRE_MS: 600000
JWT_REFRESH_EXPIRE_MS: 1209600000
JWT_REFRESH_EXPIRE_DAYS: 14
JWT_MASTER_SECRET: test
# OAuth - Kakao
KAKAO_ID: test_kakao_client
KAKAO_SECRET: test_kakao_secret
KAKAO_REDIRECT_URI: http://localhost:8080/login/oauth2/code/kakao
# OAuth - Naver
NAVER_ID: test_naver_client
NAVER_SECRET: test_naver_secret
NAVER_REDIRECT_URI: http://localhost:8080/login/oauth2/code/naver
# OAuth - Google
GOOGLE_ID: test_google_client
GOOGLE_SECRET: test_google_secret
GOOGLE_REDIRECT_URI: http://localhost:8080/login/oauth2/code/google
# Redis
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
REDIS_PASSWORD: ""
# RabbitMQ
RABBITMQ_URL: 127.0.0.1
RABBITMQ_MQ_PORT: 5672
RABBITMQ_USERNAME: guest
RABBITMQ_PASSWORD: guest
# S3
S3_BUCKET_NAME: test-bucket-ci
S3_PUBLIC_BUCKET_NAME: test-public-bucket-ci
S3_CLOUDFRONT_BASE_URL: https://test.cloudfront.net
S3_REGION: us-east-2
S3_PRESIGNED_URL_EXPIRATION: "86400"
S3_MAX_IMAGE_SIZE: "10485760"
S3_MAX_FILE_SIZE: "52428800"
S3_KEY_PREFIX: attachment
AWS_ACCESS_KEY_ID: AWSACCESSKEYIDISSECRET
AWS_SECRET_ACCESS_KEY: AWSSECRETACCESSKEYISSECRET
# FRONT
FRONT_DOMAIN_URL: http://localhost:3000
FRONT_DOMAIN_URL_V2: http://localhost:3000
FRONT_DOMAIN_URL_LOCAL: http://localhost:3000
# FCM
FCM_CREDENTIALS_PATH: ""
FCM_PROJECT_ID: ""
# SMTP
MAIL_HOST: smtp.gmail.com
MAIL_PORT: 587
MAIL_USERNAME: test@example.com
MAIL_PASSWORD: test_password
MAIL_FROM: test@example.com
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Check code formatting
run: ./gradlew checkstyleMain checkstyleTest
continue-on-error: true
- name: Build with Gradle
run: ./gradlew build -x test --refresh-dependencies
- name: Run tests
run: ./gradlew test
continue-on-error: true
- name: Test application startup
run: |
./gradlew bootRun > bootrun.log 2>&1 &
APP_PID=$!
echo "Started bootRun with PID: $APP_PID"
# 최대 60초 대기하면서 애플리케이션 시작 확인
for i in {1..60}; do
# 로그에서 시작 완료 메시지 확인
if grep -q "Started RealMatchApplication" bootrun.log; then
echo "✅ Application started successfully after ${i}s"
kill $APP_PID 2>/dev/null || true
exit 0
fi
# 프로세스가 죽었는지 확인
if ! kill -0 $APP_PID 2>/dev/null; then
echo "❌ Application process terminated unexpectedly"
echo "=== bootRun log ==="
cat bootrun.log
exit 1
fi
sleep 1
done
echo "❌ Application failed to start within 60 seconds"
echo "=== bootRun log ==="
cat bootrun.log
kill $APP_PID 2>/dev/null || true
exit 1
timeout-minutes: 2
- name: Upload build artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-reports
path: |
build/reports/
build/test-results/