Skip to content

Commit 5705be7

Browse files
committed
Ci: Add Gradle caching and cleanup properties
This commit introduces Gradle caching to the Android GitHub Actions workflow. The `actions/cache@v4` action is added to multiple jobs to cache `~/.gradle/caches` and `~/.gradle/wrapper`, keyed by the operating system and hash of Gradle files. Additionally, the cleanup step has been updated to remove `local.properties` instead of `secret.properties`.
1 parent ba615e6 commit 5705be7

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

.github/workflows/android.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ jobs:
8888
path: vendor/bundle
8989
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
9090

91+
- uses: actions/cache@v4
92+
with:
93+
path: |
94+
~/.gradle/caches
95+
~/.gradle/wrapper
96+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
97+
9198
- name: Install Ruby Dependencies
9299
run: |
93100
bundle config set path 'vendor/bundle'
@@ -126,7 +133,7 @@ jobs:
126133
run: |
127134
rm -f ${{ env.KEYSTORE_FILE }}
128135
rm -f app/${{ env.GOOGLE_PLAY_JSON }}
129-
rm -f secret.properties
136+
rm -f local.properties
130137
131138
unit-test:
132139
name: Unit Tests
@@ -148,6 +155,13 @@ jobs:
148155
path: vendor/bundle
149156
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
150157

158+
- uses: actions/cache@v4
159+
with:
160+
path: |
161+
~/.gradle/caches
162+
~/.gradle/wrapper
163+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
164+
151165
- run: |
152166
bundle config set path 'vendor/bundle'
153167
bundle install
@@ -202,6 +216,13 @@ jobs:
202216
path: vendor/bundle
203217
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
204218

219+
- uses: actions/cache@v4
220+
with:
221+
path: |
222+
~/.gradle/caches
223+
~/.gradle/wrapper
224+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
225+
205226
- run: |
206227
bundle config set path 'vendor/bundle'
207228
bundle install
@@ -236,6 +257,13 @@ jobs:
236257
path: vendor/bundle
237258
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
238259

260+
- uses: actions/cache@v4
261+
with:
262+
path: |
263+
~/.gradle/caches
264+
~/.gradle/wrapper
265+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
266+
239267
- run: |
240268
bundle config set path 'vendor/bundle'
241269
bundle install
@@ -267,6 +295,13 @@ jobs:
267295
path: vendor/bundle
268296
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
269297

298+
- uses: actions/cache@v4
299+
with:
300+
path: |
301+
~/.gradle/caches
302+
~/.gradle/wrapper
303+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
304+
270305
- run: |
271306
bundle config set path 'vendor/bundle'
272307
bundle install

0 commit comments

Comments
 (0)