chore: CI Gradle 빌드 캐시 적용 #428
Workflow file for this run
This file contains hidden or 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: Android CI | |
| env: | |
| GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false" | |
| GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true | |
| on: | |
| pull_request: | |
| push: | |
| branches: [ main, develop ] | |
| concurrency: | |
| group: build-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ci-build: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'push' || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'corretto' | |
| java-version: 21 | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v2 | |
| # 캐시 저장/정리는 job 완료 후 post action 단계에서 수행 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| # 빌드 성공 시 미사용 캐시 엔트리 자동 정리 (default: never) | |
| cache-cleanup: on-success | |
| # PR에서는 캐시 읽기만 허용, push(develop/main)에서만 캐시 갱신하여 용량 절약 | |
| cache-read-only: ${{ github.event_name == 'pull_request' }} | |
| - name: Generate local.properties | |
| run: echo '${{ secrets.LOCAL_PROPERTIES }}' | base64 -d > ./local.properties | |
| - name: Generate keystore.properties | |
| run: echo '${{ secrets.KEYSTORE_PROPERTIES }}' | base64 -d > ./keystore.properties | |
| - name: Generate google-services.json | |
| run: echo '${{ secrets.GOOGLE_SERVICES }}' | base64 -d > ./app/google-services.json | |
| - name: Code style checks | |
| run: | | |
| ./gradlew ktlintCheck detekt | |
| - name: Run build | |
| run: ./gradlew buildDebug --stacktrace | |
| stability_check: | |
| name: Compose Stability Check | |
| runs-on: ubuntu-latest | |
| if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'corretto' | |
| java-version: 21 | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v2 | |
| # 캐시 저장/정리는 job 완료 후 post action 단계에서 수행 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| # 빌드 성공 시 미사용 캐시 엔트리 자동 정리 (default: never) | |
| cache-cleanup: on-success | |
| # PR에서는 캐시 읽기만 허용, push(develop/main)에서만 캐시 갱신하여 용량 절약 | |
| cache-read-only: ${{ github.event_name == 'pull_request' }} | |
| - name: Generate local.properties | |
| run: echo '${{ secrets.LOCAL_PROPERTIES }}' | base64 -d > ./local.properties | |
| - name: Generate keystore.properties | |
| run: echo '${{ secrets.KEYSTORE_PROPERTIES }}' | base64 -d > ./keystore.properties | |
| - name: Generate google-services.json | |
| run: echo '${{ secrets.GOOGLE_SERVICES }}' | base64 -d > ./app/google-services.json | |
| - name: Compose Stability Dump | |
| run: ./gradlew stabilityDump | |
| - name: Compose Stability Check | |
| run: ./gradlew stabilityCheck |