Skip to content

[FEAT] public 버킷 설정 및 usage에 따라 분기 #500

[FEAT] public 버킷 설정 및 usage에 따라 분기

[FEAT] public 버킷 설정 및 usage에 따라 분기 #500

Workflow file for this run

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
- 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/