Skip to content

๐Ÿ”ฅ fix : ์ด๋ฏธ์ง€ ๊ด€๋ จ ๊ถŒํ•œ ๋ฌธ์ œ ์ˆ˜์ • #151

๐Ÿ”ฅ fix : ์ด๋ฏธ์ง€ ๊ด€๋ จ ๊ถŒํ•œ ๋ฌธ์ œ ์ˆ˜์ •

๐Ÿ”ฅ fix : ์ด๋ฏธ์ง€ ๊ด€๋ จ ๊ถŒํ•œ ๋ฌธ์ œ ์ˆ˜์ • #151

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: SEEAT ํ…Œ์ŠคํŠธ CI ํŒŒ์ดํ”„๋ผ์ธ
### develop์œผ๋กœ PR ์˜ฌ๋ฆด ๋•Œ, ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•˜์—ฌ, ๋นŒ๋“œ ์—ฌ๋ถ€ ๋ฐ ํ…Œ์ŠคํŠธ๋ฅผ ์ฒดํฌํ•˜๋Š” ๋กœ์ง์„ ์ˆ˜ํ–‰ํ•œ๋‹ค.
on:
pull_request:
branches: [ "develop"]
jobs:
#1. ํ†ตํ•ฉ ํ…Œ์ŠคํŠธ ์šฉ
test:
runs-on: ubuntu-22.04
services:
mysql:
image: mysql:8.0
ports:
- '3306:3306'
env:
MYSQL_DATABASE: seeat_test
MYSQL_USER: testuser
MYSQL_PASSWORD: testpass
MYSQL_ROOT_PASSWORD: root
redis:
image: redis:7.2.5
ports:
- '6379:6379'
mongo:
image: mongo:6.0
ports:
- 27017:27017
permissions:
contents: write
checks: write
pull-requests: write
steps:
# 1-1. repository checkout
- uses: actions/checkout@v4
# 1-2. jdk ํ™˜๊ฒฝ ์„ค์น˜
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
# 1-3. '*.yml' ํŒŒ์ผ ์„ธํŒ…
- name: application.yml ํŒŒ์ผ ์„ค์ •
run: |
mkdir -p src/main/resources
echo "${{ secrets.APPLICATION_YML }}" > ./src/main/resources/application.yml
- name: application-dev.yml ์„ค์ •
run: echo "${{ secrets.APPLICATION_DEV_YML }}" > ./src/main/resources/application-dev.yml
- name: application-oauth2.yml ์„ค์ •
run: echo "${{ secrets.APPLICATION_OAUTH2_YML }}" > ./src/main/resources/application-oauth2.yml
- name: application-test.yml ์„ค์ •
run: |
mkdir -p src/test/resources
echo "${{ secrets.APPLICATION_TEST_YML }}" > ./src/test/resources/application-test.yml
# 1-4. ์„ฑ๋Šฅ ํ–ฅ์ƒ์„ ์œ„ํ•œ Gradle ์บ์‹ฑ
- name: Gradle Caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}
# 1-5. ํ…Œ์ŠคํŠธ ์ปจํ…Œ์ด๋„ˆ๋“ค ์ž‘๋™์—ฌ๋ถ€ ์ฒดํฌ
- name: MySQL ์ฒดํฌ
run: |
until nc -z localhost 3306; do
echo "Waiting for MySQL..."
sleep 3
done
- name: Redis ์ฒดํฌ
run: |
until nc -z localhost 6379; do
echo "Waiting for Redis..."
sleep 3
done
- name: MongoDB ์ฒดํฌ
run: |
until nc -z localhost 27017; do
echo "Waiting for MongoDB..."
sleep 3
done
# 2. ๋นŒ๋“œ
- name: Build with Gradle Wrapper
run: ./gradlew clean build
# 3. ํ…Œ์ŠคํŠธ ์ปค๋ฒ„๋ฆฌ์ง€
- name: Test Coverage Report
id: jacoco
uses: madrapps/[email protected]
with:
title: Test Coverage Report
paths: ${{ github.workspace }}/build/jacoco/index.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-changed-files: 0
min-coverage-overall: 0
debug-mode: true
# 4. JUnit ํ…Œ์ŠคํŠธ ๊ฒฐ๊ณผ ๊ฒŒ์‹œ
- name: Test ๊ฒฐ๊ณผ ์ถœ๋ ฅ
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
junit_files: '**/build/test-results/test/TEST-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}