-
Notifications
You must be signed in to change notification settings - Fork 24
113 lines (97 loc) · 3.01 KB
/
android.yml
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Android CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
#- name: Update gradle.properties
# run: |
# echo RELEASE_STORE_FILE=release.keystore >> ./gradle.properties
# echo RELEASE_STORE_PASSWORD=${{ secrets.RELEASE_STORE_PASSWORD }} >> ./gradle.properties
# echo RELEASE_KEY_ALIAS=${{ secrets.RELEASE_KEY_ALIAS }} >> ./gradle.properties
# echo RELEASE_KEY_PASSWORD=${{ secrets.RELEASE_KEY_PASSWORD }} >> ./gradle.properties
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build --warning-mode all
test-unit:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Execute unit tests
run: ./gradlew test --stacktrace
test-instrumentation:
name: Run Instrumentation Tests
runs-on: macos-latest
strategy:
max-parallel: 1
fail-fast: false
matrix:
api-level: [23, 29, 34]
include:
- api-level: 23
target: default
- api-level: 29
target: google_apis
- api-level: 34
target: aosp_atd
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Gradle cache
uses: gradle/gradle-build-action@v2
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}-${{ matrix.target }}
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: echo "Generated AVD snapshot for caching"
- name: Execute instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew connectedCheck --stacktrace