Update README.md #6
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: CI | |
# 워크플로가 시작될 조건 지정 | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
# 실행 환경 지정 | |
runs-on: ubuntu-latest | |
# 실행 스텝 지정 | |
steps: | |
# 1. 리포지토리 체크아웃 | |
- uses: actions/checkout@v3 | |
# 2. Java 설정 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' # 또는 'temurin' 사용 가능 | |
java-version: '17' | |
# 3. Gradle 캐시 활성화 | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
# 4. gradlew 파일에 실행 권한 부여 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
# 5. Gradle로 클린 빌드 실행 | |
- name: Build with Gradle | |
run: ./gradlew clean build | |
# 6. 테스트 실행 | |
- name: Run tests | |
run: ./gradlew test | |
# 7. 빌드 아티팩트 저장 (필요한 경우) | |
- name: Upload build artifacts | |
if: success() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-artifacts | |
path: build/libs/*.jar |