perf: Merge 전 PR을 테스트 빌드 해주는 워크플로우 생성 및 CI/CD 워크플로우 최적화 진행 #2
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: Matal Backend test CI with Gradle Cache | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 | |
with: | |
gradle-version: 8.8 | |
- name: Cache Gradle dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}-${{ env.GRADLE_VERSION }} | |
restore-keys: | | |
gradle-${{ runner.os }}- | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
- name: Build and test | |
run: ./gradlew clean build |