Flutter App Redesign and 1.0.0 release #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Flutter UI Tests (Firebase Test Lab) | |
on: | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
integration_test: | |
runs-on: ubuntu-latest | |
steps: | |
# 1) Check out repo | |
- uses: actions/checkout@v3 | |
# 2) Create google-services.json if you have it in a secret | |
- name: Create google-services.json | |
run: | | |
cat <<EOF > android/app/google-services.json | |
${{ secrets.GOOGLE_SERVICES_JSON }} | |
EOF | |
# 3) Install Flutter | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.24.5' | |
channel: 'stable' | |
# 4) Install Dependencies | |
- name: Install dependencies | |
run: flutter pub get | |
# 5) Install Patrol CLI | |
- name: Install Patrol CLI | |
run: flutter pub global activate patrol_cli | |
# 6) Install Google Cloud SDK | |
- name: Install Google Cloud SDK | |
uses: google-github-actions/setup-gcloud@v1 | |
with: | |
service_account_key: ${{ secrets.GCLOUD_SERVICE_ACCOUNT_KEY }} | |
project_id: ${{ secrets.GCLOUD_PROJECT_ID }} | |
# 7) Build app & test APK | |
- name: Build app & test APK | |
run: | | |
patrol build android --target integration_test/patrol_test.dart --verbose | |
# 8) Run tests on Firebase Test Lab | |
- name: Run Tests on Firebase Test Lab | |
run: | | |
gcloud firebase test android run \ | |
--type instrumentation \ | |
--use-orchestrator \ | |
--app build/app/outputs/apk/debug/app-debug.apk \ | |
--test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk \ | |
--timeout 1m \ | |
--device model=MediumPhone.arm,version=34,locale=en,orientation=portrait \ | |
--record-video \ | |
--environment-variables clearPackageData=true |