Skip to content

Commit ead1811

Browse files
committed
Refactor GitHub Actions workflow: rename to 'Build', streamline steps, and optimize cache handling
1 parent dbdbc6d commit ead1811

1 file changed

Lines changed: 11 additions & 20 deletions

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Clean Build
1+
name: Build
22
on:
33
push:
44
branches:
@@ -21,32 +21,23 @@ jobs:
2121
java-version: '17'
2222
distribution: 'temurin'
2323

24-
- name: Grant execute permission for Gradle wrapper
25-
run: chmod +x gradlew
26-
2724
- name: Setup Gradle
2825
uses: gradle/actions/setup-gradle@v3
29-
30-
- name: Cache Gradle dependencies
31-
uses: actions/cache@v4
3226
with:
33-
path: |
34-
~/.gradle/caches
35-
~/.gradle/wrapper
36-
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
37-
restore-keys: |
38-
gradle-${{ runner.os }}-
39-
40-
- name: Accept Android licenses
41-
run: ./gradlew --no-daemon --quiet
27+
cache-read-only: ${{ github.ref != 'refs/heads/master' }}
28+
29+
- name: Build and Test
30+
run: ./gradlew build --no-daemon
4231

43-
- name: Clean and Build with Tests
44-
run: ./gradlew clean build --parallel --no-daemon
32+
- name: Build Debug APK
33+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
34+
run: ./gradlew assembleDebug --no-daemon
4535

4636
- name: Upload APK
37+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
4738
uses: actions/upload-artifact@v4
48-
if: success()
4939
with:
5040
name: debug-apk
51-
path: app/build/outputs/apk/debug/*.apk
41+
path: |
42+
**/build/outputs/apk/debug/*.apk
5243
retention-days: 7

0 commit comments

Comments
 (0)