Feature/3 branch mentoring -> weekly #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Spring Boot CI | |
on: | |
pull_request: | |
branches: | |
- weekly # 'weekly' 브랜치로 PR이 생성될 때만 실행 | |
jobs: | |
build: | |
runs-on: ubuntu-latest # job 가상환경 설정 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Gradle 명령 실행을 위한 권한을 부여합니다 | |
run: chmod +x gradlew | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Build and Test | |
run: ./gradlew clean build | |
- name: Run Spring Boot App for 30 seconds | |
run: | | |
./gradlew bootRun & | |
APP_PID=$! | |
sleep 30 | |
kill $APP_PID | |
continue-on-error: false | |
- 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 }} |