Skip to content

Commit 5fe6cea

Browse files
test: add android caching, multi sdk testing
1 parent 8c41642 commit 5fe6cea

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

.github/workflows/code-integration.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ jobs:
1717
integration_tests_android:
1818
name: 🤖 Android Tests
1919
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
api-level: [ 23, 35 ]
23+
target: [ default, google_apis ]
2024
timeout-minutes: 30
2125
steps:
2226
- uses: actions/checkout@v4
@@ -35,9 +39,34 @@ jobs:
3539
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
3640
sudo udevadm control --reload-rules
3741
sudo udevadm trigger --name-match=kvm
38-
- uses: reactivecircus/android-emulator-runner@v2
42+
- name: Gradle cache
43+
uses: gradle/actions/setup-gradle@v4
44+
- name: AVD cache
45+
uses: actions/cache@v4
46+
id: avd-cache
3947
with:
40-
api-level: 29
48+
path: |
49+
~/.android/avd/*
50+
~/.android/adb*
51+
key: avd-${{ matrix.api-level }}
52+
- name: create AVD and generate snapshot for caching
53+
if: steps.avd-cache.outputs.cache-hit != 'true'
54+
uses: reactivecircus/android-emulator-runner@v2
55+
with:
56+
api-level: ${{ matrix.api-level }}
57+
force-avd-creation: false
58+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
59+
disable-animations: false
60+
script: echo "Generated AVD snapshot for caching."
61+
- name: Run integration test
62+
uses: reactivecircus/android-emulator-runner@v2
63+
with:
64+
api-level: ${{ matrix.api-level }}
65+
target: ${{ matrix.target }}
66+
arch: x86_64
67+
force-avd-creation: false
68+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
69+
disable-animations: true
4170
script: flutter test integration_test
4271
working-directory: flutter_secure_storage/example
4372

0 commit comments

Comments
 (0)