-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (82 loc) · 3 KB
/
kaan.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
name: Android CI
on:
push:
branches:
- "*"
env:
NUMBER_OF_SHARDS: 4 # Default number of shards/emulators
jobs:
setup-emulators:
# runs-on: macos-latest # Nothing on macos-latest works ??? wtf
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
api-level: [30] # 34
target: [google_atd] # google_apis_playstore, google_apis,
arch: [x86_64] # arm64-v8a, x86
shard: [1, 2, 3, 4]
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Clear SDK Repository Cache
run: |
rm -rf $HOME/.android/cache
- name: Setup JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: "zulu"
- name: Setup Android SDK
uses: android-actions/setup-android@v2
with:
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3.3.2
- name: checkout
uses: actions/checkout@v4
- name: Enable KVM (not applicable on macOS)
if: runner.os == 'Linux'
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: Enable KVM
run: |
sudo apt-get update
sudo apt-get install qemu-kvm
sudo adduser $USER kvm
sudo chmod 666 /dev/kvm
- name: Install System Image and Create AVD
run: |
sdkmanager --install "system-images;android-${{ matrix.api-level }};${{ matrix.target }};${{ matrix.arch }}"
echo "no" | avdmanager create avd -n "testAVD${{ matrix.shard }}" -k "system-images;android-${{ matrix.api-level }};${{ matrix.target }};${{ matrix.arch }}" --force
- name: Start Emulators
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
avd-name: "testAVD${{ matrix.shard }}"
force-avd-creation: true
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
disable-animations: true
emulator-boot-timeout: 250
cores: 2
disk-size: 6000M
heap-size: 600M
script: echo "Emulator started"
# script: bash main.sh # echo "hello" && sleep 30 && echo "\n\n\n\n.\n\n\n\n\n OK !! We are done"
env:
JAVA_HOME: /opt/hostedtoolcache/Java_Zulu_jdk/17.0.11-9/x64
JAVA_HOME_17_X64: /opt/hostedtoolcache/Java_Zulu_jdk/17.0.11-9/x64
# GRADLE_BUILD_ACTION_SETUP_COMPLETED: true
# GRADLE_BUILD_ACTION_CACHE_RESTORED: true
control-flow:
needs: setup-emulators
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Execute Control Script
run: bash main.sh