Skip to content

Commit

Permalink
Merge pull request #136 from Menjil-Menjil/develop
Browse files Browse the repository at this point in the history
Develop to main
  • Loading branch information
megymj authored Dec 11, 2023
2 parents 88c886b + bbe9d83 commit de67728
Show file tree
Hide file tree
Showing 68 changed files with 2,696 additions and 987 deletions.
113 changes: 113 additions & 0 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: CI in develop branch

on:
push:
branches: [ "develop" ]

permissions:
contents: read

# PR 코멘트 등록을 위한 write 권한
checks: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest

services:
mongodb:
image: mongo:4.4
options: >-
--health-cmd mongo
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 27017:27017

mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: menjil-test
MYSQL_ROOT_PASSWORD: root
# MYSQL_USER: root
# MYSQL_PASSWORD: root33
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
steps:
# workflow 실행 전 기본적으로 checkout 필요
# 최신 버전은 v3
- uses: actions/checkout@v3
- name: Install Ubuntu dependencies
run: sudo apt-get update

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin' # jdk를 제공하는 vender사 이름 ex. zulu, adopt, microsoft

## Create secret yml files before build
- name: create application-common, local, prod, test.yml
shell: bash
run: |
touch ./src/main/resources/application-common.yml
echo "${{secrets.APPLICATION_COMMON}}" > ./src/main/resources/application-common.yml
touch ./src/main/resources/application-local.yml
echo "${{secrets.APPLICATION_LOCAL}}" > ./src/main/resources/application-local.yml
touch ./src/main/resources/application-prod.yml
echo "${{secrets.APPLICATION_PROD}}" > ./src/main/resources/application-prod.yml
touch ./src/main/resources/application-test.yml
echo "${{secrets.APPLICATION_TEST}}" > ./src/main/resources/application-test.yml
## Gradle
- name: Cache gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Verify MySQL connection
run: |
sleep 30
mysql --host 127.0.0.1 --port 3306 --user root --password=root -e "SHOW DATABASES;"
## Build
- name: Build with Gradle
run: ./gradlew clean build


## 테스트 결과 PR 코멘트에 등록
- name: Register the test results as PR comments
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: '**/build/test-results/test/TEST-*.xml'

## 테스트 실패시 코드 라인에 대한 체크 추가
- name: If test fail, add check comment on failed code line
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.html'

## 테스트 결과 업로드
- name: Upload test report
uses: actions/upload-artifact@v3
with:
name: test-report
path: build/reports/tests/test/
File renamed without changes.
155 changes: 0 additions & 155 deletions .github/workflows/develop.yml

This file was deleted.

Loading

0 comments on commit de67728

Please sign in to comment.