Skip to content

test: update test to use included mock #22

test: update test to use included mock

test: update test to use included mock #22

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:
api-level: [ 23, 35 ]
target: [ default ]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
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@v4
- 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
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Install Melos
run: flutter pub global activate melos
- uses: futureware-tech/simulator-action@v4
with:
os: iOS
os_version: ">=18.1"
model: "iPhone 15"
- run: flutter pub get
- run: flutter build ios --simulator --target=integration_test/app_test.dart
working-directory: flutter_secure_storage/example
- run: flutter test integration_test
working-directory: flutter_secure_storage/example