Skip to content

Commit 05c4f80

Browse files
committed
Try to fix CI/CD timeouts (#17)
* add free-disk-space * KVM group perms and heap sizes
1 parent d32f431 commit 05c4f80

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

.github/workflows/android.yml

+28-2
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,42 @@ jobs:
6262
name: build-artifacts
6363
path: ./app/build/outputs/
6464
test:
65-
runs-on: macos-latest
65+
runs-on: ubuntu-latest
6666
strategy:
6767
matrix:
6868
api-level: [33]
6969
steps:
70+
- name: Delete unnecessary tools 🔧
71+
uses: jlumbroso/[email protected]
72+
with:
73+
android: false # Don't remove Android tools
74+
tool-cache: true # Remove image tool cache - rm -rf "$AGENT_TOOLSDIRECTORY"
75+
dotnet: true # rm -rf /usr/share/dotnet
76+
haskell: true # rm -rf /opt/ghc...
77+
swap-storage: true # rm -f /mnt/swapfile (4GiB)
78+
docker-images: false # Takes 16s, enable if needed in the future
79+
large-packages: false # includes google-cloud-sdk and it's slow
80+
81+
- name: Enable KVM group perms
82+
run: |
83+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
84+
sudo udevadm control --reload-rules
85+
sudo udevadm trigger --name-match=kvm
86+
ls /dev/kvm
87+
7088
- name: checkout
7189
uses: actions/checkout@v3
90+
7291
- name: Set up JDK 17
7392
uses: actions/setup-java@v3
7493
with:
7594
java-version: '17'
7695
distribution: 'temurin'
7796
cache: gradle
97+
7898
- name: Gradle cache
7999
uses: gradle/gradle-build-action@v2
100+
80101
- name: AVD cache
81102
uses: actions/cache@v3
82103
id: avd-cache
@@ -85,6 +106,7 @@ jobs:
85106
~/.android/avd/*
86107
~/.android/adb*
87108
key: avd-${{ matrix.api-level }}
109+
88110
- name: create AVD and generate snapshot for caching
89111
if: steps.avd-cache.outputs.cache-hit != 'true'
90112
uses: reactivecircus/android-emulator-runner@v2
@@ -94,8 +116,11 @@ jobs:
94116
target: google_apis
95117
arch: x86_64
96118
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
97-
disable-animations: false
119+
disable-animations: true
120+
disk-size: 6000M
121+
heap-size: 600M
98122
script: echo "Generated AVD snapshot for caching."
123+
99124
- name: run tests
100125
uses: reactivecircus/android-emulator-runner@v2
101126
with:
@@ -106,6 +131,7 @@ jobs:
106131
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
107132
disable-animations: true
108133
script: gradle connectedCheck --scan
134+
109135
- name: Archive test reports
110136
uses: actions/upload-artifact@v3
111137
if: success() || failure()

0 commit comments

Comments
 (0)