Skip to content

ci(android): add Firebase Test Lab workflow for integration tests#204

Merged
SERDUN merged 1 commit intomainfrom
ci/firebase-test-lab
Mar 20, 2026
Merged

ci(android): add Firebase Test Lab workflow for integration tests#204
SERDUN merged 1 commit intomainfrom
ci/firebase-test-lab

Conversation

@SERDUN
Copy link
Copy Markdown
Member

@SERDUN SERDUN commented Mar 20, 2026

Why

Android emulators cannot reliably run the callkeep integration tests.
The ConnectionService API, foreground service lifecycle, and the
dual-process teardown (main + :callkeep_core) depend on real OS
scheduler and Telecom behaviour that emulators do not reproduce.

Firebase Test Lab provides real devices and integrates cleanly with
GitHub Actions, making it the lowest-friction path to running these
tests in CI without managing physical lab hardware.

What

  • Adds .github/workflows/integration-tests-firebase.yml

    • Triggers on pull_request to develop/main (same-repo PRs only — fork PRs are skipped because secrets are unavailable for forks) and workflow_dispatch for manual runs
    • Sets up JDK 17 + Flutter 3.32.0, authenticates with GCP via google-github-actions/auth
    • Builds debug APK via flutter build apk --debug (unambiguous output path)
    • Builds instrumented test APK via ./gradlew :app:assembleAndroidTest
    • Runs the full suite on Pixel 6 / API 33 via gcloud firebase test android run
    • Uploads built APKs as GitHub Actions artifacts on every run (if: always()), retained 14 days
    • Does not touch any existing workflow files
  • Adds an Integration Tests section to README.md

    • Documents run_integration_tests.sh for local runs
    • Explains why emulators are insufficient
    • Documents workflow_dispatch trigger and required secrets

Required setup

A maintainer must add these secrets in GitHub repo settings:

Secret Description
FIREBASE_SERVICE_ACCOUNT JSON key for a GCP service account with Firebase Test Lab permissions
FIREBASE_PROJECT_ID GCP project ID linked to your Firebase project

Adds .github/workflows/integration-tests-firebase.yml that builds the
example app and instrumented test APKs via flutter/Gradle and runs the
full integration test suite on real hardware via Firebase Test Lab.

Changes from initial version:
- Switch debug APK build to `flutter build apk --debug` so the output
  path is unambiguous (always build/app/outputs/apk/debug/app-debug.apk)
- Gate the job on same-repo PRs only to avoid auth failures from forks
  (secrets are unavailable for fork pull requests)

Triggers on pull_request to develop/main (same-repo) and workflow_dispatch
for manual runs. Built APKs are uploaded as artifacts on every run
(if: always()), retained 14 days.

Adds an Integration Tests section to README.md documenting local run
instructions, CI trigger, and required secrets.
@SERDUN SERDUN merged commit 3117cc4 into main Mar 20, 2026
1 of 2 checks passed
@SERDUN SERDUN deleted the ci/firebase-test-lab branch March 20, 2026 09:53
SERDUN added a commit that referenced this pull request Mar 20, 2026
Adds .github/workflows/integration-tests-firebase.yml that builds the
example app and instrumented test APKs via flutter/Gradle and runs the
full integration test suite on real hardware via Firebase Test Lab.

Changes from initial version:
- Switch debug APK build to `flutter build apk --debug` so the output
  path is unambiguous (always build/app/outputs/apk/debug/app-debug.apk)
- Gate the job on same-repo PRs only to avoid auth failures from forks
  (secrets are unavailable for fork pull requests)

Triggers on pull_request to develop/main (same-repo) and workflow_dispatch
for manual runs. Built APKs are uploaded as artifacts on every run
(if: always()), retained 14 days.

Adds an Integration Tests section to README.md documenting local run
instructions, CI trigger, and required secrets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant