-
-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (66 loc) · 2.55 KB
/
android-ci.yml
File metadata and controls
78 lines (66 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#
# © 2026-present https://github.com/cengiz-pz
#
name: Android CI
on:
pull_request:
branches:
- main
paths:
- 'common/config/**'
- 'common/**/*.gradle.kts'
- 'android/config/**'
- 'android/src/**'
- 'android/**/*.gradle.kts'
jobs:
android-build-and-test:
name: Android Build & Tests
runs-on: ubuntu-22.04
steps:
# -- Checkout ------------------------------------------------------------
- name: Checkout
uses: actions/checkout@v6
# -- Node ----------------------------------------------------------------
- name: Install Node
uses: ./.github/actions/install-node
# -- Java ----------------------------------------------------------------
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
cache: gradle
# -- Android SDK ---------------------------------------------------------
- name: Setup Android SDK
uses: android-actions/setup-android@v4
# -- Gradle --------------------------------------------------------------
- name: Make Gradle wrapper executable
run: chmod +x common/gradlew
# -- Run Android build ---------------------------------------------------
- name: Build Android debug
working-directory: common
run: ./gradlew buildAndroidDebug --no-daemon --stacktrace
# -- Run Android tests ---------------------------------------------------
# printTestSummary:
# • runs testDebugUnitTest (ignoreFailures = true so coverage can follow)
# • runs createDebugUnitTestCoverageReport
# • prints a formatted TEST RESULTS + CODE COVERAGE table
# • throws GradleException (non-zero exit) only when failed > 0
- name: Run Android unit tests
id: android_tests
working-directory: common
run: ./gradlew :android:printTestSummary --no-daemon
continue-on-error: true
# Upload the JUnit XML reports so GitHub can annotate the PR even when
# the step above fails (always: true keeps this step active on failure).
- name: Upload Android test results
if: always()
uses: actions/upload-artifact@v7
with:
name: android-test-results
path: android/build/test-results/testDebugUnitTest/
if-no-files-found: ignore
# Re-fail the job after the artifact is safely uploaded
- name: Fail job if tests failed
if: steps.android_tests.outcome == 'failure'
run: exit 1