Skip to content

Commit 6226536

Browse files
authored
Merge pull request #284 from YAPP-Github/BOOK-290-chore/#163
chore: CI Gradle 빌드 캐시 적용
2 parents 612e184 + ceeba01 commit 6226536

2 files changed

Lines changed: 23 additions & 6 deletions

File tree

.github/workflows/android-ci.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ env:
66

77
on:
88
pull_request:
9+
push:
10+
branches: [ main, develop ]
911

1012
concurrency:
1113
group: build-${{ github.ref }}
@@ -15,7 +17,7 @@ jobs:
1517
ci-build:
1618
runs-on: ubuntu-latest
1719

18-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
20+
if: ${{ github.event_name == 'push' || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }}
1921

2022
steps:
2123
- name: Checkout
@@ -30,10 +32,14 @@ jobs:
3032
- name: Setup Android SDK
3133
uses: android-actions/setup-android@v2
3234

35+
# 캐시 저장/정리는 job 완료 후 post action 단계에서 수행
3336
- name: Setup Gradle
34-
uses: gradle/gradle-build-action@v2
37+
uses: gradle/actions/setup-gradle@v4
3538
with:
36-
gradle-home-cache-cleanup: true
39+
# 빌드 성공 시 미사용 캐시 엔트리 자동 정리 (default: on-success)
40+
# cache-cleanup: on-success
41+
# PR에서는 캐시 읽기만 허용, push(develop/main)에서만 캐시 갱신하여 용량 절약
42+
cache-read-only: ${{ github.event_name == 'pull_request' }}
3743

3844
- name: Generate local.properties
3945
run: echo '${{ secrets.LOCAL_PROPERTIES }}' | base64 -d > ./local.properties
@@ -70,10 +76,14 @@ jobs:
7076
- name: Setup Android SDK
7177
uses: android-actions/setup-android@v2
7278

79+
# 캐시 저장/정리는 job 완료 후 post action 단계에서 수행
7380
- name: Setup Gradle
74-
uses: gradle/gradle-build-action@v2
81+
uses: gradle/actions/setup-gradle@v4
7582
with:
76-
gradle-home-cache-cleanup: true
83+
# 빌드 성공 시 미사용 캐시 엔트리 자동 정리 (default: on-success)
84+
# cache-cleanup: on-success
85+
# PR에서는 캐시 읽기만 허용, push(develop/main)에서만 캐시 갱신하여 용량 절약
86+
cache-read-only: ${{ github.event_name == 'pull_request' }}
7787

7888
- name: Generate local.properties
7989
run: echo '${{ secrets.LOCAL_PROPERTIES }}' | base64 -d > ./local.properties

gradle.properties

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
1010
# When configured, Gradle will run in incubating parallel mode.
1111
# This option should only be used with decoupled projects. For more details, visit
1212
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
13-
# org.gradle.parallel=true
13+
org.gradle.parallel=true
14+
15+
# Enable Gradle configuration caching
16+
org.gradle.configuration-cache=true
17+
18+
# Enable Gradle build cache
19+
org.gradle.caching=true
20+
1421
# AndroidX package structure to make it clearer which packages are bundled with the
1522
# Android operating system, and which are packaged with your app's APK
1623
# https://developer.android.com/topic/libraries/support-library/androidx-rn

0 commit comments

Comments
 (0)