Skip to content

test: Add web integration_test #115

test: Add web integration_test

test: Add web integration_test #115

Workflow file for this run

name: integration test
on:
push:
branches:
- main
pull_request:
defaults:
run:
shell: bash
env:
PUB_ENVIRONMENT: bot.github
jobs:
drive_android:
name: Android
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
api-level: [23]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.24.x
cache: true
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- 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: Install melos
run: |
flutter pub global activate melos
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
echo "$HOME/AppData/Local/Pub/Cache/bin" >> $GITHUB_PATH
- name: Initialize workspace through melos
run: melos bootstrap
- name: Run Flutter Integration tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
script: flutter test integration_test -d android
working-directory: flutter_secure_storage_x/example
drive_ios:
name: iOS
runs-on: macos-latest
timeout-minutes: 30
strategy:
matrix:
simulator: [ {os: "17.0", model: "iPhone 15"} ]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.24.x
cache: true
- name: Install melos
run: |
flutter pub global activate melos
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
echo "$HOME/AppData/Local/Pub/Cache/bin" >> $GITHUB_PATH
- name: Initialize workspace through melos
run: melos bootstrap
- uses: futureware-tech/simulator-action@v3
with:
os: iOS
os_version: ${{ matrix.simulator.os }}
model: ${{ matrix.simulator.model }}
- name: Run Flutter Integration tests
working-directory: flutter_secure_storage_x/example
run: flutter test integration_test -d iphone
drive_web_js:
name: Web (JS)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.24.x
cache: true
- name: Install melos
run: |
flutter pub global activate melos
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
echo "$HOME/AppData/Local/Pub/Cache/bin" >> $GITHUB_PATH
- name: Initialize workspace through melos
run: melos bootstrap
- uses: nanasess/setup-chromedriver@v2
- name: Setup chromedriver
run: |
chromedriver --port=4444
- name: Run Flutter Integration tests
working-directory: flutter_secure_storage_x/example
run: flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/app_test.dart \
-d chrome
drive_web:
name: Web (WASM)
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
option: [ "", "--wasm" ]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.24.x
cache: true
- name: Install melos
run: |
flutter pub global activate melos
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
echo "$HOME/AppData/Local/Pub/Cache/bin" >> $GITHUB_PATH
- name: Initialize workspace through melos
run: melos bootstrap
- name: Setup chromedriver
run: |
npx @puppeteer/browsers install chromedriver@stable
chromedriver --port=4444 &
- name: Run Flutter Integration tests
working-directory: flutter_secure_storage_x/example
run: flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/app_test.dart \
${{ matrix.option }} \
-d chrome