-
Notifications
You must be signed in to change notification settings - Fork 9
87 lines (76 loc) · 2.61 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
name: lint, build, and test
on:
pull_request:
paths-ignore:
- "**.md"
push:
paths-ignore:
- "**.md"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- uses: gradle/actions/setup-gradle@v3
- name: Lint
run: ./gradlew lint
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- uses: gradle/actions/setup-gradle@v3
- name: Build the app
run: ./gradlew build -x lint
- uses: actions/upload-artifact@v4
with:
path: app/build/outputs/apk/debug/app-debug.apk
name: app-debug
- uses: actions/upload-artifact@v4
with:
path: app/build/outputs/apk/release/app-release-unsigned.apk
name: app-release-unsigned
test:
runs-on: ubuntu-latest
steps:
- name: Delete unnecessary tools to free up some space
uses: jlumbroso/[email protected]
with:
android: false # Don't remove Android tools
large-packages: false # includes google-cloud-sdk and it's slow
tool-cache: true
dotnet: true
haskell: true
swap-storage: true
docker-images: true
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- uses: gradle/actions/setup-gradle@v3
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Accept Android licenses
run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses || true
# NOTE: Limiting to one gradle worker because otherwise it was trying to install the Android Emulator multiple times
# simultaneously, causing FileAlreadyExistsExceptions.
- name: Run instrumented tests on a subset of supported devices
run: |
./gradlew ciGroupdebugAndroidTest \
-Dorg.gradle.workers.max=1 \
-Pandroid.testoptions.manageddevices.emulator.gpu=swiftshader_indirect \
--info