Skip to content

Commit d03e9d5

Browse files
committed
Use Java 21 and ensure AVD cache in release.yml
1 parent b99e607 commit d03e9d5

File tree

1 file changed

+32
-9
lines changed

1 file changed

+32
-9
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/setup-java@v4
1919
with:
2020
distribution: temurin
21-
java-version: 17
21+
java-version: 21
2222

2323
- uses: actions/cache@v4
2424
with:
@@ -59,7 +59,7 @@ jobs:
5959
- uses: actions/setup-java@v4
6060
with:
6161
distribution: temurin
62-
java-version: 17
62+
java-version: 21
6363

6464
- uses: actions/cache@v4
6565
with:
@@ -81,14 +81,22 @@ jobs:
8181
android-tests:
8282
needs: build
8383
runs-on: ubuntu-latest
84+
timeout-minutes: 60
85+
env:
86+
API_LEVEL: 23
87+
ARCH: x86_64
88+
DISK_SIZE: 2048M
89+
strategy:
90+
matrix:
91+
module: [ primitives, theming, platformtheme ]
8492
steps:
8593
- uses: actions/checkout@v4
8694
with:
8795
ref: ${{ github.event.release.tag_name }}
8896
- uses: actions/setup-java@v4
8997
with:
9098
distribution: temurin
91-
java-version: 17
99+
java-version: 21
92100

93101
- name: Gradle cache
94102
uses: gradle/actions/setup-gradle@v4
@@ -107,6 +115,18 @@ jobs:
107115
with:
108116
name: build-outputs
109117

118+
- name: Create AVD
119+
if: steps.avd-cache.outputs.cache-hit != 'true'
120+
uses: reactivecircus/android-emulator-runner@v2
121+
with:
122+
api-level: ${{ env.API_LEVEL }}
123+
arch: ${{ env.ARCH }}
124+
disk-size: ${{ env.DISK_SIZE }}
125+
force-avd-creation: false
126+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
127+
disable-animations: false
128+
script: echo "Generated AVD snapshot for caching."
129+
110130
- name: Enable Hardware Acceleration
111131
run: |
112132
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
@@ -120,15 +140,18 @@ jobs:
120140
path: |
121141
~/.android/avd/*
122142
~/.android/adb*
123-
key: avd-25-no-options
143+
key: avd-${{ env.API_LEVEL }}-${{ env.ARCH }}-${{ env.DISK_SIZE }}
124144

125145
- name: Android Tests
126146
uses: reactivecircus/android-emulator-runner@v2
127147
with:
128-
api-level: 23
129-
profile: 'pixel_4'
130-
arch: 'x86_64'
131-
script: ./gradlew composeunstyled-primitives:connectedAndroidTest composeunstyled-theming:connectedAndroidTest
148+
api-level: ${{ env.API_LEVEL }}
149+
arch: ${{ env.ARCH }}
150+
disk-size: ${{ env.DISK_SIZE }}
151+
force-avd-creation: false
152+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
153+
disable-animations: true
154+
script: ./gradlew composeunstyled-${{ matrix.module }}:connectedDebugAndroidTest
132155

133156
publish:
134157
needs: [build, desktop-tests, android-tests]
@@ -142,7 +165,7 @@ jobs:
142165
- uses: actions/setup-java@v4
143166
with:
144167
distribution: temurin
145-
java-version: 17
168+
java-version: 21
146169

147170
- uses: actions/cache@v4
148171
with:

0 commit comments

Comments
 (0)