Skip to content

[Android] Set invalidatedByBiometricEnrollment to false #64

[Android] Set invalidatedByBiometricEnrollment to false

[Android] Set invalidatedByBiometricEnrollment to false #64

name: 📱 Code Integration
on:
push:
branches: [master, develop]
pull_request:
env:
PUB_ENVIRONMENT: bot.github
defaults:
run:
shell: bash
jobs:
# Android Integration Tests
integration_tests_android:
name: 🤖 Android Tests
runs-on: ubuntu-latest
strategy:
matrix:
include:
- api-level: 24
target: default
- api-level: 36
target: google_apis
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- uses: actions/setup-java@v5
with:
distribution: "temurin"
java-version: "17"
- uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Install Melos
run: flutter pub global activate melos
- name: Enable KVM
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: Gradle cache
# uses: gradle/actions/setup-gradle@v5
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
force-avd-creation: 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."
- name: Run integration test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: flutter test integration_test
working-directory: flutter_secure_storage/example
# iOS Integration Tests
integration_tests_ios:
name: 🍏 iOS Tests
runs-on: macos-latest
timeout-minutes: 30
needs: integration_tests_android
env:
SIM_OS: iOS
SIM_OS_VERSION: "18.5"
SIM_DEVICE: "iPhone 16"
steps:
- uses: actions/checkout@v6
- uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Install Melos
run: flutter pub global activate melos
- name: Reset Simulator State
run: |
xcrun simctl shutdown all || true
xcrun simctl erase all || true
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService || true
sudo killall -9 Simulator || true
sleep 2
- uses: futureware-tech/simulator-action@v4
with:
os: ${{ env.SIM_OS }}
os_version: ${{ env.SIM_OS_VERSION }}
model: ${{ env.SIM_DEVICE }}
erase_before_boot: true
wait_for_boot: true
- name: Wait for Boot
run: |
DEVICE_ID=$(xcrun simctl list devices | grep "${SIM_DEVICE}" | grep Booted | awk -F '[()]' '{print $2}')
for i in {1..30}; do
booted=$(xcrun simctl list devices | grep "$DEVICE_ID" | grep -c Booted || true)
if [ "$booted" = "1" ]; then
echo "Simulator booted: $DEVICE_ID"
exit 0
fi
echo "Waiting for boot… ($i/30)"
sleep 2
done
echo "Simulator boot timeout"
exit 1
- run: flutter pub get
working-directory: flutter_secure_storage/example
- name: Execute Integration Tests
working-directory: flutter_secure_storage/example
run: |
DEVICE_ID=$(xcrun simctl list devices | grep "${SIM_DEVICE}" | grep Booted | awk -F '[()]' '{print $2}')
flutter drive \
--target=integration_test/app_test.dart \
-d "$DEVICE_ID"