Skip to content

Commit

Permalink
Merge pull request #1923 from fzyzcjy/feat/12016
Browse files Browse the repository at this point in the history
Fix Android CI failing without code change because it cannot create AVD
  • Loading branch information
fzyzcjy committed May 6, 2024
2 parents 6e632d2 + fc3ad70 commit 68b4cfb
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,9 @@ jobs:
# ref https://betterprogramming.pub/test-flutter-apps-on-android-with-github-actions-abdba2137b4
test_flutter_native_android:
name: 'Test :: Flutter :: Native:: Android'
# Must use MacOS because of reasons mentioned in `android-emulator-runner`'s readme.
runs-on: macos-latest
# # Must use MacOS because of reasons mentioned in `android-emulator-runner`'s readme.
# runs-on: macos-latest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -776,6 +777,11 @@ jobs:
with:
distribution: 'zulu'
java-version: "17.x"
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
Expand All @@ -790,16 +796,16 @@ jobs:
with:
api-level: ${{ matrix.api-level }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
# disable-animations: false
script: echo "Generated AVD snapshot for caching."

# execute
- uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
arch: x86_64
# emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
# arch: x86_64
profile: ${{ matrix.device }}
script: ./frb_internal test-flutter-native --package ${{ matrix.package }}

Expand Down
2 changes: 2 additions & 0 deletions frb_example/pure_dart/test/api/event_listener_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Future<void> main({bool skipRustLibInit = false}) async {

await closeEventListenerTwinNormal();

await Future.delayed(const Duration(seconds: 1));

expect(logs, ['one', 'two']);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Future<void> main({bool skipRustLibInit = false}) async {

await closeEventListenerTwinRustAsyncSse();

await Future.delayed(const Duration(seconds: 1));

expect(logs, ['one', 'two']);
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Future<void> main({bool skipRustLibInit = false}) async {

await closeEventListenerTwinRustAsync();

await Future.delayed(const Duration(seconds: 1));

expect(logs, ['one', 'two']);
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Future<void> main({bool skipRustLibInit = false}) async {

await closeEventListenerTwinSse();

await Future.delayed(const Duration(seconds: 1));

expect(logs, ['one', 'two']);
});
}
2 changes: 2 additions & 0 deletions frb_example/pure_dart_pde/test/api/event_listener_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Future<void> main({bool skipRustLibInit = false}) async {

await closeEventListenerTwinNormal();

await Future.delayed(const Duration(seconds: 1));

expect(logs, ['one', 'two']);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Future<void> main({bool skipRustLibInit = false}) async {

await closeEventListenerTwinRustAsync();

await Future.delayed(const Duration(seconds: 1));

expect(logs, ['one', 'two']);
});
}

0 comments on commit 68b4cfb

Please sign in to comment.