2626 runs-on : ubuntu-latest
2727 env :
2828 ENCORE_AUTH_KEY : ${{ secrets.ENCORE_AUTH_KEY }}
29+ BROWSERSTACK_USERNAME : ${{ secrets.BROWSERSTACK_USERNAME }}
30+ BROWSERSTACK_ACCESS_KEY : ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
31+ BROWSERSTACK_HUB_URL : https://hub.browserstack.com/wd/hub
2932
3033 steps :
3134 - name : Checkout code
@@ -91,14 +94,37 @@ jobs:
9194 echo "Waiting for frontend to be ready..."
9295 timeout 60 bash -c 'until curl -sf http://localhost:5173 > /dev/null; do sleep 2; done'
9396
94- - name : Run Complete QA Suite
97+ - name : Validate BrowserStack Credentials
98+ run : |
99+ if [ -z "${{ secrets.BROWSERSTACK_USERNAME }}" ] || [ -z "${{ secrets.BROWSERSTACK_ACCESS_KEY }}" ]; then
100+ echo "⚠️ WARNING: BrowserStack credentials not configured"
101+ echo " E2E tests will be skipped"
102+ echo " To enable E2E tests in CI:"
103+ echo " 1. Go to BrowserStack account settings to get credentials"
104+ echo " 2. Go to: GitHub repo → Settings → Secrets and variables → Actions"
105+ echo " 3. Create new secrets: BROWSERSTACK_USERNAME, BROWSERSTACK_ACCESS_KEY"
106+ export SKIP_E2E=1
107+ else
108+ echo "✅ BrowserStack credentials available - E2E tests enabled"
109+ export SKIP_E2E=0
110+ fi
111+ echo "SKIP_E2E=$SKIP_E2E" >> $GITHUB_ENV
112+
113+ - name : Run Complete QA Suite (with E2E)
114+ if : env.SKIP_E2E == '0'
95115 run : cd .cursor && task qa:all
116+
117+ - name : Run QA Suite without E2E
118+ if : env.SKIP_E2E == '1'
119+ run : cd .cursor && task qa:all:no-e2e
96120
97121# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
98122# Implementation Notes:
99123# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
100124#
101- # SIMPLICITY: Single job runs `task qa:all` - same as pre-push hook
125+ # SIMPLICITY: Single job runs conditional QA suite based on credentials
126+ # - With BrowserStack: `task qa:all` (includes E2E tests)
127+ # - Without BrowserStack: `task qa:all:no-e2e` (skips E2E tests)
102128# MIRRORS LOCAL: Exact same command developers run locally
103129# DRY: No duplication - all logic in .cursor/commands/qa/Taskfile.yml
104130#
@@ -108,7 +134,11 @@ jobs:
108134# 3. qa:lint - Linting (backend + frontend)
109135# 4. qa:typecheck - TypeScript validation (frontend)
110136# 5. qa:unit - Unit tests (backend only - encore test)
111- # 6. qa:e2e - E2E tests (frontend Playwright)
137+ # 6. qa:e2e - E2E tests (frontend Playwright) - REQUIRES BrowserStack
138+ #
139+ # What `task qa:all:no-e2e` runs (same as above, but WITHOUT E2E):
140+ # - Skips E2E tests when BrowserStack credentials unavailable
141+ # - Useful for early CI setup or pull requests from forks
112142#
113143# Note: Auto-fix (qa:fix) is intentionally excluded from qa:all
114144# - Git hooks should validate, not modify uncommitted code
@@ -125,24 +155,32 @@ jobs:
125155# - Uses standard ports from .env (4000 backend, 5173 frontend)
126156# - In-memory database for tests
127157# - ENCORE_AUTH_KEY: GitHub Secret (app-specific auth key) for Encore Cloud authentication
158+ # - BROWSERSTACK_USERNAME & BROWSERSTACK_ACCESS_KEY: Optional GitHub Secrets for E2E tests
128159#
129160# GitHub Secrets Setup:
161+ #
162+ # REQUIRED:
130163# 1. Go to: https://app.encore.cloud/screengraph-ovzi → App Settings → Auth Keys
131164# 2. Create new auth key (NOT `encore auth token` - that's different!)
132165# 3. Go to: GitHub repo → Settings → Secrets and variables → Actions
133166# 4. Create new secret: ENCORE_AUTH_KEY
134167# 5. Paste the auth key from step 2
135168#
169+ # OPTIONAL (for E2E tests):
170+ # 1. Get BrowserStack credentials (account settings or ask team)
171+ # 2. Go to: GitHub repo → Settings → Secrets and variables → Actions
172+ # 3. Create new secrets: BROWSERSTACK_USERNAME, BROWSERSTACK_ACCESS_KEY
173+ # 4. Without these, E2E tests will be skipped (not failed)
174+ #
136175# Testing before activation:
137176# 1. Create feature branch
138- # 2. Rename to ci.yml
139- # 3. Push to trigger workflow
140- # 4. Verify qa:all passes
141- # 5. Merge to main
142-
177+ # 2. Push to trigger workflow
178+ # 3. Verify appropriate QA suite passes (all or all:no-e2e)
179+ # 4. Merge to main after review
180+ #
143181# Validation checklist when modifying:
144182# 1. Create feature branch
145183# 2. Push to trigger workflow
146- # 3. Confirm qa:all passes in GitHub Actions
184+ # 3. Confirm appropriate QA suite passes in GitHub Actions
147185# 4. Merge to main after review
148186
0 commit comments