Skip to content

Instantly share code, notes, and snippets.

@VB10
Created June 29, 2025 19:46
Show Gist options
  • Save VB10/d22735d9b15cc0dbe94c6b5c88c96460 to your computer and use it in GitHub Desktop.
Save VB10/d22735d9b15cc0dbe94c6b5c88c96460 to your computer and use it in GitHub Desktop.
Android UI Tests To FirebaseTestLab
name: Android UI Tests To FirebaseTestLab
on:
push:
branches:
- main
workflow_dispatch:
jobs:
android_test:
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout code
uses: actions/checkout@v3
- name: πŸ”§ Set up Java 17
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: πŸ” Cache Flutter SDK
uses: actions/cache@v3
id: flutter-cache
with:
path: ~/flutter
key: ${{ runner.os }}-flutter-stable-v1
- name: πŸ”½ Install Flutter SDK
if: steps.flutter-cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/flutter/flutter.git --branch stable --depth 1 ~/flutter
- name: πŸ› οΈ Add Flutter to PATH
run: echo "$HOME/flutter/bin" >> $GITHUB_PATH
- name: πŸ“¦ Cache Flutter dependencies
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.pub-cache
${{ github.workspace }}/build
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-flutter-
- name: πŸ” Decrypt Android keys
run: sh ./.github/scripts/decrypt_android_keys.sh
- name: πŸ“¦ flutter pub get
run: flutter pub get
- name: πŸš€ Install FlutterFire CLI
run: dart pub global activate flutterfire_cli
- name: πŸ’Ž Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
bundler-cache: true
- name: πŸ“¦ bundle install
run: bundle install
working-directory: android
- name: πŸ”€ Run Android scripts
run: ./scripts/build.sh force && ./scripts/lang.sh
- name: πŸš€ Activate Patrol CLI
run: dart pub global activate patrol_cli
- name: πŸ—οΈ Build APKs
run: patrol build android --target integration_test/start_test.dart --flavor development
- id: auth
name: πŸ” Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS_DEV }}'
- name: ☁️ Set up gcloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: πŸ§ͺ Run Firebase Test Lab
run: |
gcloud firebase test android run \
--type instrumentation \
--use-orchestrator \
--app build/app/outputs/apk/development/debug/app-development-debug.apk \
--test build/app/outputs/apk/androidTest/development/debug/app-development-debug-androidTest.apk \
--timeout 1m \
--device model=MediumPhone.arm,version=34,locale=en,orientation=portrait \
--record-video \
--environment-variables=clearPackageData=true,IS_TEST_LAB=true \
--project hatayiyasat\
--results-dir=test_results \
--results-history-name=instrumentation_tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment