Skip to content

Commit 8f093dc

Browse files
committed
ci: optimize android workflow and upload build artifacts
1 parent 7fffc44 commit 8f093dc

1 file changed

Lines changed: 29 additions & 7 deletions

File tree

.github/workflows/android-ci.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,17 @@ on:
77
branches: ["main"]
88
workflow_dispatch:
99

10+
concurrency:
11+
group: android-ci-${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
1017
jobs:
1118
build:
1219
runs-on: ubuntu-latest
20+
timeout-minutes: 30
1321

1422
steps:
1523
- name: Checkout
@@ -25,11 +33,25 @@ jobs:
2533
- name: Setup Gradle
2634
uses: gradle/actions/setup-gradle@v4
2735

28-
- name: Lint debug
29-
run: ./gradlew lintDebug
30-
31-
- name: Unit tests
32-
run: ./gradlew testDebugUnitTest
36+
- name: Lint, test and assemble
37+
run: ./gradlew --stacktrace lintDebug testDebugUnitTest :app:assembleDebug :app:assembleRelease
3338

34-
- name: Assemble debug and release
35-
run: ./gradlew :app:assembleDebug :app:assembleRelease
39+
- name: Upload APK artifacts
40+
if: success()
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: app-apks
44+
path: |
45+
app/build/outputs/apk/debug/*.apk
46+
app/build/outputs/apk/release/*.apk
47+
if-no-files-found: ignore
48+
49+
- name: Upload reports (always)
50+
if: always()
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: android-reports
54+
path: |
55+
app/build/reports/**
56+
app/build/test-results/**
57+
if-no-files-found: ignore

0 commit comments

Comments
 (0)