Skip to content

Commit

Permalink
Merge pull request #64 from KNU-HAEDAL/issue/#57
Browse files Browse the repository at this point in the history
Issue/#57
  • Loading branch information
bayy1216 authored Aug 24, 2024
2 parents b88bfef + 2052f5b commit 5e33899
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ jobs:
java-version: '17'
distribution: 'adopt'

- name: Setup Gradle # Gradle을 설정합니다.
run: |
chmod +x ./gradlew
./gradlew clean build
- name: Gradle 명령 실행을 위한 권한을 부여합니다
run: chmod +x ./gradlew

- name: Gradle build를 수행합니다.
run: ./gradlew clean build

- name: Build docker image and push to docker hub # Docker 이미지를 빌드하고 Docker Hub에 푸시합니다.
run: |
Expand All @@ -45,8 +46,8 @@ jobs:
cd:
runs-on: ubuntu-latest # ubuntu 최신 버전에서 script를 실행
needs: ci # ci job이 성공적으로 끝나야 cd job이 실행됩니다.
# appleboy/ssh-action@master 액션을 사용하여 지정한 서버에 ssh로 접속하고, script를 실행합니다.

# appleboy/ssh-action@master 액션을 사용하여 지정한 서버에 ssh로 접속하고, script를 실행합니다.
# script의 내용은 도커의 기존 프로세스들을 제거하고, docker repo로부터 방금 위에서 push한 내용을 pull 받아 실행하는 것입니다.
steps:
- name: Deploy to server
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test

on:
push:
branches: [ "main" ] # main 브랜치에 push가 발생하면 workflow가 실행됩니다.
pull_request:
branches: [ "main", "issue/*", "develop" ]
permissions: write-all

jobs:
ci:
runs-on: ubuntu-latest

# set up java
steps:
- name: Checkout Repository # 저장소를 체크아웃합니다.
uses: actions/checkout@v4

- name: Cache Gradle dependencies # Gradle 의존성을 캐시합니다.
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: Set up JDK 17 # JDK 17을 설정합니다.
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'

- name: Gradle 명령 실행을 위한 권한을 부여합니다
run: chmod +x ./gradlew

- name: Gradle build를 수행합니다.
run: ./gradlew clean build

- name: 테스트 결과를 PR에 코멘트로 등록합니다
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: '**/build/test-results/test/TEST-*.xml'

- name: 테스트 실패 시, 실패한 코드 라인에 Check 코멘트를 등록합니다
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
token: ${{ github.token }}

0 comments on commit 5e33899

Please sign in to comment.