This guide explains how to test GitHub Actions workflows locally using act.
Via devbox (recommended):
devbox shellVia Homebrew (macOS/Linux):
brew install actVia Docker:
# act is available as a container
docker pull ghcr.io/catthehacker/ubuntu:act-latestls .github/workflows/*.ymlOutput:
e2e-full.yml- Full E2E test suitepr-checks.yml- Fast PR validation checks
act -W .github/workflows/pr-checks.yml -lThis shows all jobs defined in the workflow.
# Dry run to check syntax
act -W .github/workflows/pr-checks.yml -n./.github/workflows/test-locally.sh pr-checks android-plugin-tests# Run Android plugin tests
act -W .github/workflows/pr-checks.yml -j android-plugin-tests
# Run with verbose output
act -W .github/workflows/pr-checks.yml -j android-plugin-tests -v
# Run with specific platform
act -W .github/workflows/pr-checks.yml -j android-plugin-tests \
--container-architecture linux/amd64Android emulator tests require KVM hardware acceleration, which is challenging to set up in Docker containers. For local testing:
Option 1: Test validation only
# Test Android plugin validation (no emulator needed)
act -W .github/workflows/pr-checks.yml -j android-plugin-testsOption 2: Test on actual CI
# Push to a test branch to trigger CI
git checkout -b test/workflows
git push origin test/workflowsOption 3: Use GitHub's local runner Follow GitHub's guide: https://docs.github.com/en/actions/hosting-your-own-runners
To test the workflow logic without actually running emulators:
# Dry run to validate workflow syntax and job dependencies
act -W .github/workflows/e2e-full.yml -n
# List all jobs in the E2E workflow
act -W .github/workflows/e2e-full.yml -liOS simulator workflows require macOS and cannot run in Docker containers. For local testing:
Option 1: Run iOS tests natively
# Must be on macOS
cd examples/ios
devbox shell
SIM_HEADLESS=1 devbox run --pure start-sim minOption 2: Validate workflow syntax
# Check for YAML errors and job configuration
act -W .github/workflows/pr-checks.yml -j ios-plugin-tests -nReact Native workflows combine Android and iOS. Test them separately:
# Test Android part of React Native workflow
act -W .github/workflows/e2e-full.yml -j react-native-e2e \
--matrix platform:android
# Validate iOS part (syntax only on non-macOS)
act -W .github/workflows/e2e-full.yml -j react-native-e2e -n# Dry run (validate syntax only)
act -n
# Verbose output
act -v
# Use specific workflow file
act -W .github/workflows/pr-checks.yml
# Run specific job
act -j job-name
# List available workflows
act -l
# Use specific runner image
act -P ubuntu-24.04=ghcr.io/catthehacker/ubuntu:act-24.04
# Pass secrets
act -s GITHUB_TOKEN=your_token
# Bind mount local directory
act --bindTest individual jobs from the PR checks:
# Android plugin tests (Ubuntu)
act -W .github/workflows/pr-checks.yml -j android-plugin-tests
# iOS plugin tests (macOS only)
# Run on actual macOS machine:
act -W .github/workflows/pr-checks.yml -j ios-plugin-tests
# Validate status check aggregation
act -W .github/workflows/pr-checks.yml -j status-check# Test Android E2E (with matrix)
act workflow_dispatch -W .github/workflows/e2e-full.yml \
-j android-e2e \
--matrix device:min
# Validate iOS E2E syntax
act workflow_dispatch -W .github/workflows/e2e-full.yml \
-j ios-e2e -n
# Test summary job
act workflow_dispatch -W .github/workflows/e2e-full.yml \
-j e2e-summary# Ensure you're in the repository root
cd /path/to/templates
act -l# Start Docker Desktop or Docker daemon
sudo systemctl start docker # Linux
open -a Docker # macOSThis is expected. KVM passthrough to Docker is complex and not recommended. Instead:
- Run validation tests that don't need emulators
- Test on actual CI for emulator-based tests
- Use native devbox commands for local emulator testing
# Increase Docker memory limit in Docker Desktop settings
# Or use smaller test matrix
act -j android-plugin-tests # Run one job at a time- Test workflow syntax with
act -nbefore pushing - Run validation jobs locally when possible
- Use actual CI for full emulator/simulator tests
- Check job dependencies with
act -lto see execution order - Iterate quickly by testing specific jobs instead of full workflows