CI/CD Integration
Running browser tests with pest-plugin-bridge in CI/CD is the primary use case for this plugin. This section provides modular documentation for GitHub Actions.
How Do I Combine Two Separate Repositories?
The Key Question
If your Laravel API and frontend live in separate repositories, you're probably wondering: "How do I bring them together in CI?"
The answer is simple: GitHub Actions can checkout multiple repositories in a single workflow.
steps:
# 1. Checkout your API repo into ./backend
- uses: actions/checkout@v4
with:
path: backend
# 2. Checkout your frontend repo into ./frontend
- uses: actions/checkout@v4
with:
repository: your-org/frontend-repo
path: frontendAfter this, your directory structure in CI looks like:
$GITHUB_WORKSPACE/
+-- backend/ # Your Laravel API
| +-- app/
| +-- tests/Browser/
| +-- composer.json
+-- frontend/ # Your frontend repo
+-- src/
+-- package.jsonThen configure Bridge to use the frontend:
// backend/tests/Pest.php
Bridge::setDefault('http://localhost:3000')
->serve('npm run dev', cwd: '../frontend');That's it. Both projects are now in the same runner, and pest-plugin-bridge handles starting/stopping servers automatically.
For complete details including private repos and branch synchronization, see Multi-Repository.
How This Section Works
Each page is a standalone module you can combine:
| Page | What It Adds |
|---|---|
| Basic Setup | Minimal working workflow (monorepo, no database) |
| Multi-Repository | Separate frontend repository checkout |
| Manual Triggers | Run tests manually with branch/group selection |
| SQLite Database | File-based SQLite configuration |
| MySQL Database | MySQL service or external connection |
| Caching | Speed up CI with dependency caching |
| Debugging | Screenshots, artifacts, troubleshooting |
| Advanced | Matrix builds, parallel tests, timeouts |
Start with Basic Setup, then add modules as needed.
CI Execution Flow
Prerequisites
Before setting up CI/CD, ensure you have:
- A Laravel API project with pest-plugin-bridge installed
- A frontend project (Nuxt, React, Vue, etc.) in the same repo or separate repo
- Basic familiarity with GitHub Actions
Repository Structures
Monorepo
my-app/
+-- backend/ # Laravel API
| +-- app/
| +-- tests/
| | +-- Browser/
| +-- composer.json
+-- frontend/ # Frontend app
| +-- src/
| +-- package.json
+-- .github/
+-- workflows/
+-- browser-tests.ymlMulti-Repository
your-organization/
+-- api/ # Laravel API repository
| +-- tests/Browser/ # Browser tests live here
| +-- .github/workflows/ # CI runs from API repo
|
+-- frontend/ # Separate frontend repository
+-- src/
+-- package.jsonQuick Start
- Start with Basic Setup - Get a minimal workflow running
- Add Multi-Repository if you have separate repos
- Add Manual Triggers for on-demand testing with branch selection
- Add SQLite or MySQL for database tests
- Add Caching to speed up builds
- Add Debugging for failure artifacts