Skip to content

Commit 5635761

Browse files
committed
First attempt at Android emulator test
1 parent 1673a73 commit 5635761

File tree

1 file changed

+48
-6
lines changed

1 file changed

+48
-6
lines changed

.github/workflows/main.yml

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,12 @@ jobs:
218218
integration_test:
219219
strategy:
220220
matrix:
221-
#runner: [ubuntu-latest, macos-latest]
222-
# TODO: Ubuntu tests don't start in on GH actions, can't reproduce locally.
223-
runner: [macos-latest]
221+
runner: [ubuntu-latest, macos-latest]
224222
needs: [test, fetch_sqlite]
225223
runs-on: ${{ matrix.runner }}
224+
timeout-minutes: 30
225+
env:
226+
AVD_NAME: ubuntu-avd-x86_64-34
226227
steps:
227228
- name: List simulators
228229
if: runner.os == 'macos'
@@ -244,9 +245,22 @@ jobs:
244245

245246
- name: Setup runner
246247
if: runner.os == 'linux'
248+
# https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#usage--examples
247249
run: |
248-
sudo apt-get update -y
249-
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libstdc++-12-dev
250+
sudo apt-get install -y cmake ninja-build pkg-config libgtk-3-dev libstdc++-12-dev
251+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
252+
sudo udevadm control --reload-rules
253+
sudo udevadm trigger --name-match=kvm
254+
255+
- name: AVD Cache
256+
uses: actions/cache@v4
257+
id: avd-cache
258+
if: runner.os == 'linux'
259+
with:
260+
path: |
261+
~/.android/avd/*
262+
~/.android/adb*
263+
key: avd-35
250264

251265
- name: Download compiled sqlite3
252266
uses: actions/download-artifact@v5
@@ -277,11 +291,25 @@ jobs:
277291
flutter test integration_test -d macos
278292
279293
- name: Flutter sqlite3 tests on Linux
280-
if: runner.os == 'linux'
294+
if: false # runner.os == 'linux' currently broken in ci, can't reproduce locally or in Ubuntu VM
281295
working-directory: examples/flutter_integration_tests
282296
run: |
283297
flutter test integration_test -d linux
284298
299+
- name: SQLite Android emulator tests
300+
uses: reactivecircus/android-emulator-runner@v2
301+
if: runner.os == 'linux'
302+
with:
303+
api-level: 34
304+
force-avd-creation: false
305+
target: google_apis
306+
arch: x86_64
307+
disable-animations: false
308+
avd-name: $AVD_NAME
309+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
310+
script: flutter test integration_test
311+
working-directory: "examples/flutter_integration_tests"
312+
285313
- name: Enable sqlite3mc
286314
run: |
287315
dart run tool/hook_overrides.dart compiled-ciphers
@@ -293,3 +321,17 @@ jobs:
293321
flutter config --enable-swift-package-manager
294322
flutter test integration_test -Dsqlite3.multipleciphers=true
295323
flutter test integration_test -Dsqlite3.multipleciphers=true -d macos
324+
325+
- name: sqlite3mc Android emulator tests
326+
uses: reactivecircus/android-emulator-runner@v2
327+
if: runner.os == 'linux'
328+
with:
329+
api-level: 34
330+
force-avd-creation: false
331+
target: google_apis
332+
arch: x86_64
333+
disable-animations: false
334+
avd-name: $AVD_NAME
335+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
336+
script: flutter test integration_test -Dsqlite3.multipleciphers=true
337+
working-directory: "examples/flutter_integration_tests"

0 commit comments

Comments
 (0)