|
1 | 1 | # GitHub Actions CI Workflow - SCAFFOLD |
2 | 2 | # |
3 | 3 | # Status: NOT YET ACTIVE (rename to ci.yml to activate) |
4 | | -# Purpose: Run automated tests and quality checks on every push/PR |
| 4 | +# Purpose: Run comprehensive QA suite on every push/PR |
5 | 5 | # |
6 | | -# This workflow will use the unified Task automation system. |
7 | | -# All checks mirror local development (Husky hooks + Cursor commands) |
| 6 | +# This workflow uses the unified `task qa:all` command. |
| 7 | +# Mirrors Husky pre-push hook exactly (same commands, same checks). |
8 | 8 | # |
9 | 9 | # To activate: |
10 | 10 | # 1. Rename this file from ci.yml.scaffold to ci.yml |
|
22 | 22 |
|
23 | 23 | jobs: |
24 | 24 | # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
25 | | - # Job 1: Founder Rules Validation |
| 25 | + # Comprehensive QA Suite (mirrors pre-push hook) |
26 | 26 | # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
27 | | - # Mirrors: .husky/pre-commit hook |
28 | | -# Command: bun run task founder:rules:check |
| 27 | + # Command: cd .cursor && task qa:all |
| 28 | + # Includes: fix, rules, smoke, lint, typecheck, unit, e2e |
29 | 29 |
|
30 | | - founder-rules: |
31 | | - name: Validate Founder Rules |
| 30 | + qa-all: |
| 31 | + name: QA Suite (fix + rules + smoke + lint + typecheck + unit + e2e) |
32 | 32 | runs-on: ubuntu-latest |
33 | 33 |
|
34 | 34 | steps: |
35 | 35 | - name: Checkout code |
36 | 36 | uses: actions/checkout@v4 |
37 | 37 |
|
38 | | - # TODO: Install Task |
39 | | - # - name: Install go-task |
40 | | - # run: | |
41 | | - # sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin |
42 | | - # task --version |
| 38 | + - name: Install go-task |
| 39 | + run: | |
| 40 | + sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin |
| 41 | + task --version |
43 | 42 |
|
44 | | - # TODO: Install bun |
45 | | - # - name: Setup bun |
46 | | - # uses: oven-sh/setup-bun@v1 |
47 | | - # with: |
48 | | - # bun-version: latest |
| 43 | + - name: Setup bun |
| 44 | + uses: oven-sh/setup-bun@v1 |
| 45 | + with: |
| 46 | + bun-version: latest |
49 | 47 |
|
50 | | - # TODO: Install Node.js (for automation scripts) |
51 | | - # - name: Setup Node.js |
52 | | - # uses: actions/setup-node@v4 |
53 | | - # with: |
54 | | - # node-version: '20' |
| 48 | + - name: Setup Node.js |
| 49 | + uses: actions/setup-node@v4 |
| 50 | + with: |
| 51 | + node-version: '20' |
55 | 52 |
|
56 | | - # TODO: Run founder rules check |
57 | | - # - name: Check Founder Rules |
58 | | - # run: bun run task founder:rules:check |
59 | | - |
60 | | - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
61 | | - # Job 2: Backend Smoke Tests |
62 | | - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
63 | | - # Mirrors: .husky/pre-push hook (backend part) |
64 | | -# Command: bun run qa:smoke:backend |
65 | | - |
66 | | - backend-smoke: |
67 | | - name: Backend Smoke Tests |
68 | | - runs-on: ubuntu-latest |
69 | | - needs: founder-rules |
70 | | - |
71 | | - steps: |
72 | | - - name: Checkout code |
73 | | - uses: actions/checkout@v4 |
74 | | - |
75 | | - # TODO: Setup dependencies |
76 | | - # - Install Task, bun, Node.js (same as above) |
77 | | - |
78 | | - # TODO: Install backend dependencies |
79 | | - # - name: Install Backend Dependencies |
80 | | - # run: cd backend && bun install |
81 | | - |
82 | | - # TODO: Start backend |
83 | | - # - name: Start Backend |
84 | | - # run: cd .cursor && task backend:dev & |
85 | | - # # Give it time to start |
86 | | - # sleep 5 |
87 | | - |
88 | | - # TODO: Run smoke tests |
89 | | - # - name: Run Backend Smoke Tests |
90 | | - # run: bun run qa:smoke:backend |
91 | | - |
92 | | - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
93 | | - # Job 3: Frontend Smoke Tests |
94 | | - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
95 | | - # Mirrors: .husky/pre-push hook (frontend part) |
96 | | -# Command: bun run qa:smoke:frontend |
97 | | - |
98 | | - frontend-smoke: |
99 | | - name: Frontend Smoke Tests |
100 | | - runs-on: ubuntu-latest |
101 | | - needs: founder-rules |
102 | | - |
103 | | - steps: |
104 | | - - name: Checkout code |
105 | | - uses: actions/checkout@v4 |
| 53 | + - name: Install Encore CLI |
| 54 | + run: | |
| 55 | + curl -L https://encore.dev/install.sh | bash |
| 56 | + echo "$HOME/.encore/bin" >> $GITHUB_PATH |
106 | 57 |
|
107 | | - # TODO: Setup dependencies |
108 | | - # - Install Task, bun, Node.js (same as above) |
| 58 | + - name: Install Backend Dependencies |
| 59 | + run: cd backend && bun install |
109 | 60 |
|
110 | | - # TODO: Install frontend dependencies |
111 | | - # - name: Install Frontend Dependencies |
112 | | - # run: cd frontend && bun install |
| 61 | + - name: Install Frontend Dependencies |
| 62 | + run: cd frontend && bun install |
113 | 63 |
|
114 | | - # TODO: Build frontend |
115 | | - # - name: Build Frontend |
116 | | - # run: cd .cursor && task frontend:build |
| 64 | + - name: Start Backend |
| 65 | + run: | |
| 66 | + cd backend |
| 67 | + encore run & |
| 68 | + echo "Waiting for backend to be ready..." |
| 69 | + timeout 60 bash -c 'until curl -sf http://localhost:4000/health > /dev/null; do sleep 2; done' |
117 | 70 |
|
118 | | - # TODO: Start frontend |
119 | | - # - name: Start Frontend |
120 | | - # run: cd .cursor && task frontend:dev & |
121 | | - # sleep 5 |
122 | | - |
123 | | - # TODO: Run smoke tests |
124 | | - # - name: Run Frontend Smoke Tests |
125 | | - # run: bun run qa:smoke:frontend |
126 | | - |
127 | | - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
128 | | - # Job 4: Type Checking |
129 | | - # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
130 | | - # Additional quality check |
131 | | -# Command: bun run typecheck |
132 | | - |
133 | | - typecheck: |
134 | | - name: TypeScript Type Checking |
135 | | - runs-on: ubuntu-latest |
136 | | - needs: founder-rules |
137 | | - |
138 | | - steps: |
139 | | - - name: Checkout code |
140 | | - uses: actions/checkout@v4 |
| 71 | + - name: Start Frontend |
| 72 | + run: | |
| 73 | + cd frontend |
| 74 | + bun run dev & |
| 75 | + echo "Waiting for frontend to be ready..." |
| 76 | + timeout 60 bash -c 'until curl -sf http://localhost:5173 > /dev/null; do sleep 2; done' |
141 | 77 |
|
142 | | - # TODO: Setup and run typecheck |
143 | | - # - name: Run TypeScript Type Checking |
144 | | - # run: bun run typecheck |
| 78 | + - name: Run Complete QA Suite |
| 79 | + run: cd .cursor && task qa:all |
145 | 80 |
|
146 | 81 | # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
147 | 82 | # Implementation Notes: |
148 | 83 | # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
149 | 84 | # |
150 | | -# 1. All Task commands are the SAME as local development |
151 | | -# 2. CI enforces the same rules as Husky hooks (redundant safety) |
152 | | -# 3. Jobs run in parallel where possible (founder-rules first, others parallel) |
153 | | -# 4. Uses ubuntu-latest for consistency |
154 | | -# 5. Each job installs its own dependencies (GitHub Actions best practice) |
| 85 | +# SIMPLICITY: Single job runs `task qa:all` - same as pre-push hook |
| 86 | +# MIRRORS LOCAL: Exact same command developers run locally |
| 87 | +# DRY: No duplication - all logic in .cursor/commands/qa/Taskfile.yml |
155 | 88 | # |
156 | | -# Dependencies needed: |
157 | | -# - go-task (Taskfile runner) |
158 | | -# - bun (package manager) |
159 | | -# - Node.js (for automation scripts) |
160 | | -# - Encore CLI (for backend) |
| 89 | +# What `task qa:all` runs: |
| 90 | +# 1. qa:fix - Auto-fix linting/formatting |
| 91 | +# 2. qa:rules - Validate founder rules (no console.log, no any, American spelling) |
| 92 | +# 3. qa:smoke - Health checks (backend + frontend) |
| 93 | +# 4. qa:lint - Linting (backend + frontend) |
| 94 | +# 5. qa:typecheck - TypeScript validation (frontend) |
| 95 | +# 6. qa:unit - Unit tests (backend only - encore test) |
| 96 | +# 7. qa:e2e - E2E tests (frontend Playwright) |
161 | 97 | # |
162 | | -# Environment variables: |
163 | | -# - BACKEND_PORT, FRONTEND_PORT (auto-resolved from automation/scripts/env.mjs) |
| 98 | +# Dependencies: |
| 99 | +# - go-task - Taskfile runner |
| 100 | +# - bun - Package manager |
| 101 | +# - Node.js - Automation scripts |
| 102 | +# - Encore CLI - Backend runtime |
164 | 103 | # |
165 | | -# Security: |
166 | | -# - No secrets needed for CI checks |
167 | | -# - Database: Use in-memory or test DB |
168 | | -# - No external API calls in smoke tests |
| 104 | +# Environment: |
| 105 | +# - Uses standard ports from .env (4000 backend, 5173 frontend) |
| 106 | +# - In-memory database for tests |
| 107 | +# - No secrets required |
169 | 108 | # |
170 | | -# To test before activating: |
| 109 | +# Testing before activation: |
171 | 110 | # 1. Create feature branch |
172 | 111 | # 2. Rename to ci.yml |
173 | 112 | # 3. Push to trigger workflow |
174 | | -# 4. Verify all jobs pass |
| 113 | +# 4. Verify qa:all passes |
175 | 114 | # 5. Merge to main |
176 | 115 |
|
0 commit comments