Skip to content

Commit d380a2f

Browse files
authored
Update Github actions to fix builds (#185)
* Remove running instrumentation tests * Only build debug instead of all flavors and build type permutations * run instrumentation tests for API level 34 * Update build.yml add --daemon option for connectedDebugAndroidTest * androidTest: add steps to delete unnecessary tools and enable KVM group perms * add retries for instrumentation tests to account for flaky emulators * Fix typo in comment in build.yml * update androidTest to run on api levels 30 and 34 * remove max_attempts, update plugin versions * Remove api level 30 from androidTest for now
1 parent 0479d2e commit d380a2f

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
- name: Check lint
4040
run: ./gradlew lintDebug
4141

42-
- name: Build all build type and flavor permutations
43-
run: ./gradlew assemble
42+
- name: Build debug
43+
run: ./gradlew assembleDebug
4444

4545
- name: Run local tests
4646
run: ./gradlew testDebug
@@ -60,27 +60,45 @@ jobs:
6060

6161
androidTest:
6262
needs: build
63-
runs-on: macOS-latest # enables hardware acceleration in the virtual machine
63+
runs-on: ubuntu-latest
6464
timeout-minutes: 55
6565
strategy:
6666
matrix:
67-
api-level: [26, 30]
67+
api-level: [34]
6868

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
71-
uses: actions/checkout@v3
89+
uses: actions/checkout@v4
7290

7391
- name: Copy CI gradle.properties
7492
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
7593

7694
- name: Set up JDK 17
77-
uses: actions/setup-java@v3
95+
uses: actions/setup-java@v4
7896
with:
7997
distribution: 'zulu'
8098
java-version: 17
8199

82100
- name: Setup Gradle
83-
uses: gradle/gradle-build-action@v2
101+
uses: gradle/gradle-build-action@v3
84102

85103
- name: Run instrumentation tests
86104
uses: reactivecircus/android-emulator-runner@v2
@@ -90,7 +108,7 @@ jobs:
90108
disable-animations: true
91109
disk-size: 6000M
92110
heap-size: 600M
93-
script: ./gradlew connectedDebugAndroidTest
111+
script: ./gradlew connectedDebugAndroidTest --daemon
94112

95113
- name: Upload test reports
96114
if: always()

0 commit comments

Comments
 (0)