This directory contains GitHub Actions workflows for automated testing, deployment, and maintenance of the Unbuilt application.
Purpose: Run comprehensive end-to-end tests on every pull request and push to main/develop branches.
Triggers:
- Pull requests to main/develop
- Pushes to main/develop
- Manual workflow dispatch
Jobs:
e2e-tests: Run E2E tests across Chromium, Firefox, and WebKitmobile-tests: Run E2E tests on mobile viewportstest-summary: Generate test summary and report
Artifacts:
- Test results (30 days retention)
- Screenshots on failure (7 days retention)
- Videos on failure (7 days retention)
- Trace files on failure (7 days retention)
Duration: ~15-20 minutes
Purpose: Update pull request status based on E2E test results and block merge on failures.
Triggers:
- Pull request opened, synchronized, or reopened
Jobs:
pr-check: Wait for E2E tests and update PR statustest-coverage-report: Generate and post coverage report
Features:
- PR comments with test results
- Commit status updates
- Merge blocking on failure
- Test coverage statistics
Duration: ~1-2 minutes (after E2E tests complete)
Purpose: Run minimal smoke tests to validate critical functionality after deployment.
Triggers:
- After successful production deployment
- Manual workflow dispatch
- Scheduled (every 6 hours)
Jobs:
smoke-tests: Run critical smoke testshealth-check: Validate application health
Features:
- Fast execution (< 5 minutes)
- Failure notifications (GitHub issues, Slack)
- Health endpoint validation
- Environment selection (production/staging)
Duration: ~3-5 minutes
Purpose: Automatically clean up old test artifacts to manage storage.
Triggers:
- Scheduled (daily at 2 AM UTC)
- Manual workflow dispatch
Retention Policies:
- Test results: 30 days
- Screenshots: 7 days
- Videos: 7 days
- Traces: 7 days
Duration: ~1-2 minutes
Add the following secrets in repository settings (Settings → Secrets and variables → Actions):
Required:
TEST_DATABASE_URL- Test database connection stringTEST_JWT_SECRET- JWT secret for testsTEST_SESSION_SECRET- Session secret for testsPRODUCTION_URL- Production application URL (e.g., https://unbuilt.one)
Optional:
STAGING_URL- Staging application URLSLACK_WEBHOOK_URL- Slack webhook for notifications
Workflows are enabled by default. To disable a workflow:
- Go to Actions tab
- Select the workflow
- Click "..." menu
- Select "Disable workflow"
Follow the guide in BRANCH_PROTECTION.md to set up branch protection rules.
Quick setup:
- Go to Settings → Branches
- Add rule for
mainbranch - Enable "Require status checks to pass before merging"
- Select required checks:
- E2E Tests (chromium)
- E2E Tests (firefox)
- E2E Tests (webkit)
- Mobile E2E Tests
- PR E2E Test Status
- Enable "Require branches to be up to date before merging"
- Save changes
Test E2E workflow:
- Create a test branch
- Make a small change
- Open PR to main
- Verify E2E tests run automatically
- Check PR comment for results
Test smoke tests:
- Go to Actions → Production Smoke Tests
- Click "Run workflow"
- Select environment
- Click "Run workflow"
- Verify tests complete successfully
Via GitHub UI:
- Go to Actions tab
- Select workflow
- Click "Run workflow"
- Configure options (if available)
- Click "Run workflow"
Via GitHub CLI:
# Run E2E tests
gh workflow run e2e-tests.yml
# Run smoke tests on production
gh workflow run smoke-tests.yml -f environment=production
# Run smoke tests on custom URL
gh workflow run smoke-tests.yml -f url=https://staging.unbuilt.oneTest Results:
- Go to Actions tab
- Select workflow run
- View job logs
- Download artifacts for detailed reports
PR Comments:
- Automatically posted on PR
- Shows test summary
- Links to artifacts
- Debugging instructions on failure
Artifacts:
- Go to workflow run
- Scroll to "Artifacts" section
- Download desired artifact
- Extract and view reports
Track these metrics to ensure workflow health:
- Pass Rate: > 95% for E2E tests, > 99% for smoke tests
- Execution Time: < 15 minutes for E2E, < 5 minutes for smoke
- False Positive Rate: < 5%
- Artifact Storage: Monitor usage, clean up regularly
Automatic Alerts:
- Smoke test failures create GitHub issues
- Slack notifications on critical failures (if configured)
Manual Monitoring:
- Review failed workflow runs weekly
- Check artifact storage usage monthly
- Review flaky test reports
Check:
- Workflow files are in
.github/workflows/ - Workflows are enabled (Actions tab)
- Triggers are configured correctly
- Branch protection doesn't block workflow runs
Fix:
- Verify workflow syntax with
gh workflow view - Check workflow logs for errors
- Ensure repository has Actions enabled
Common Causes:
- Environment variable mismatch
- Missing secrets
- Timing issues
- Database connection problems
Debug Steps:
- Check workflow logs
- Download test artifacts
- Review screenshots/videos
- Compare with local test results
- Check environment variables
Check:
- Artifact paths exist
- Workflow has write permissions
- Artifact size is within limits (500MB per artifact)
Fix:
- Verify paths in workflow file
- Check workflow permissions
- Reduce artifact size if needed
Check:
- Status check names match exactly
- Workflow has write permissions for pull requests
- Branch protection is configured correctly
Fix:
- Verify status check names in branch protection
- Check workflow permissions
- Review pr-status-check.yml logs
- Test locally first: Use
actto test workflows locally - Use matrix strategy: Run tests in parallel across browsers
- Set appropriate timeouts: Prevent hanging workflows
- Cache dependencies: Speed up workflow execution
- Use secrets: Never hardcode sensitive data
- Keep tests fast: Target < 15 minutes for E2E
- Fix flaky tests: Don't ignore intermittent failures
- Update selectors: Keep pace with UI changes
- Monitor execution time: Optimize slow tests
- Review artifacts: Clean up regularly
- Use secrets: For all sensitive data
- Limit permissions: Grant minimum required permissions
- Review logs: Don't expose secrets in logs
- Rotate secrets: Regularly update secrets
- Monitor access: Track who triggers workflows
For issues with workflows:
- Check this README
- Review workflow logs
- Check GitHub Actions documentation
- Contact DevOps team
- Create an issue with
ci/cdlabel