Product Guide
CI Integration
Set up Midstream in your CI pipeline
CI Integration
Midstream integrates seamlessly with GitHub Actions and other CI providers.
GitHub Actions (Recommended)
Midstream works automatically with GitHub Actions. When tests run in a GitHub Actions workflow, the SDK uses GITHUB_TOKEN for authentication.
Basic Setup
Your existing Playwright workflow just works:
name: Playwright Tests
on:
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
No additional configuration needed - Midstream detects the CI environment and posts demo links to your pull request.
Other CI Providers
For CI providers other than GitHub Actions, you'll need to provide an API key.
Generate an API Key
- Go to your project settings in the Midstream dashboard
- Navigate to "API Keys"
- Create a new key with appropriate permissions
Configure Your CI
Set the MIDSTREAM_API_KEY environment variable:
# GitLab CI example
test:
script:
- npm ci
- npx playwright test
variables:
MIDSTREAM_API_KEY: $MIDSTREAM_API_KEY
Pull Request Comments
When tests complete, Midstream comments on your pull request with:
- Links to each checkpoint demo
- Preview screenshots
- Quick access to view the demo
Troubleshooting
Demos not appearing on PR
- Check that your tests are passing
- Verify the
midstream.jsonconfiguration is valid - Ensure the GitHub App has access to your repository
Authentication errors
- For GitHub Actions: No action needed, uses automatic token
- For other CI: Verify
MIDSTREAM_API_KEYis set correctly