0Pricing
React Native Academy · Lesson

Maestro in CI with GitHub Actions

Add a Maestro test job to a GitHub Actions workflow, start an Android emulator in CI, run the Maestro suite, and upload the result artifacts on failure.

Why Run Maestro in CI?

Running Maestro tests locally on your machine catches bugs before you push. Running them in CI (Continuous Integration) catches bugs before they reach main and are seen by other team members. Every pull request can automatically trigger the E2E suite and block merging if any test fails.

GitHub Actions is the most popular CI platform for open-source and small-team projects. It runs workflows defined in YAML files inside .github/workflows/. An Android emulator runs inside a GitHub-hosted Linux runner, while iOS requires a macOS runner.

GitHub Actions Workflow Basics

A GitHub Actions workflow file defines triggers (when to run), jobs (parallel or sequential work units), and steps (individual commands within a job). Each job runs on a fresh virtual machine specified by the runs-on key.

Maestro E2E tests require a running Android emulator or iOS Simulator. Android emulators run on ubuntu-latest runners. iOS Simulators require macos-latest runners, which are more expensive in GitHub Actions minutes.

# .github/workflows/e2e.yml
name: E2E Tests

on:
  pull_request:
    branches: [main, develop]
  push:
    branches: [main]

jobs:
  e2e-android:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run Maestro E2E Tests
        run: echo 'Steps to follow...'

All lessons in this course

  1. Installing Maestro and Running Your First Flow
  2. Assertions and Waiting for Elements
  3. Testing Multi-Screen User Journeys
  4. Maestro in CI with GitHub Actions
← Back to React Native Academy