[chore] 테스트 CI 초기 세팅 #394
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: | |
- 'be/**' # fe/로 시작하는 모든 브랜치에 대해 푸시 이벤트 트리거 | |
pull_request: | |
branches: | |
- main | |
- develop | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: backend # 모든 'run' 단계의 기본 작업 디렉토리를 'backend'로 설정 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 (Amazon Corretto) | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'corretto' # 올바른 배포판 이름 | |
java-version: '17' | |
- 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 Gradle wrapper | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build --no-daemon | |
- name: Run tests | |
run: ./gradlew test |