Skip to content

Commit 50b2419

Browse files
authored
Unified CI Pipeline with Consolidated Reviews (#9)
* [unknown] Agent task completed Agent-Type: unknown Agent-ID: a131ec9 Files-Edited: 1 Files-New: 1 Files-Deleted: 0 * [unknown] Agent task completed Agent-Type: unknown Agent-ID: ac1f32c Files-Edited: 1 Files-New: 1 Files-Deleted: 0 * [unknown] Agent task completed Agent-Type: unknown Agent-ID: a073a08 Files-Edited: 2 Files-New: 0 Files-Deleted: 6 * [unknown] Agent task completed Agent-Type: unknown Agent-ID: a7891f3 Files-Edited: 5 Files-New: 5 Files-Deleted: 0 * fix: Only run reviews on pull_request events to avoid duplicates - Added github.event_name == 'pull_request' check to reviews job - Fixed concurrency group to use head_ref for proper PR branch handling - Prevents duplicate review runs when pushing to PR branches
1 parent fe9d9d7 commit 50b2419

12 files changed

Lines changed: 1848 additions & 1483 deletions

.github/actions/consolidate-comment/action.yml

Lines changed: 507 additions & 0 deletions
Large diffs are not rendered by default.

.github/templates/README.md

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
# CI Configuration Templates
2+
3+
This directory contains template CI configuration files for different types of repositories. These templates provide pre-configured setups that you can copy and customize for your project.
4+
5+
## Quick Start
6+
7+
1. Choose the appropriate template for your project type
8+
2. Copy the template to your repository root as `.github/ci-config.yml`
9+
3. Customize any settings as needed
10+
4. Commit and push to enable the CI pipeline
11+
12+
```bash
13+
# Example: Copy the Vercel template
14+
cp .github/templates/template-vercel.yml .github/ci-config.yml
15+
```
16+
17+
## Available Templates
18+
19+
### template-vercel.yml
20+
21+
**Best for:** Next.js applications deployed to Vercel
22+
23+
**Features:**
24+
- Full basic CI (lint, typecheck, vitest)
25+
- Playwright E2E tests against Vercel previews
26+
- AI-powered code reviews with UI screenshot analysis
27+
- Vercel deployment integration
28+
29+
**Use when:**
30+
- Building a Next.js or React application
31+
- Deploying frontend to Vercel
32+
- Want AI to review UI changes visually
33+
34+
---
35+
36+
### template-supabase-vercel.yml
37+
38+
**Best for:** Full-stack apps with Supabase backend and Vercel frontend
39+
40+
**Features:**
41+
- Everything in template-vercel.yml
42+
- Supabase preview branches for PRs
43+
- Database migration automation
44+
- E2E tests with database access
45+
46+
**Use when:**
47+
- Using Supabase for authentication, database, or storage
48+
- Need isolated database environments for PR previews
49+
- Running E2E tests that require database seeding
50+
51+
**Required secrets:**
52+
- `SUPABASE_ACCESS_TOKEN`
53+
- `SUPABASE_PROJECT_ID` (or configured per-environment)
54+
55+
---
56+
57+
### template-cloudflare.yml
58+
59+
**Best for:** Applications deployed to Cloudflare Pages
60+
61+
**Features:**
62+
- Full basic CI (lint, typecheck, vitest)
63+
- Playwright E2E tests against Cloudflare previews
64+
- AI-powered code reviews with UI screenshot analysis
65+
- Cloudflare Pages deployment integration
66+
67+
**Use when:**
68+
- Deploying to Cloudflare Pages
69+
- Using Cloudflare Workers or D1
70+
- Want edge-first performance
71+
72+
**Required secrets:**
73+
- `CLOUDFLARE_API_TOKEN`
74+
- `CLOUDFLARE_ACCOUNT_ID`
75+
76+
---
77+
78+
### template-non-deployable.yml
79+
80+
**Best for:** Libraries, GitHub Actions, CLI tools, and packages
81+
82+
**Features:**
83+
- Full basic CI (lint, typecheck, vitest)
84+
- AI-powered code reviews (no UI review)
85+
- No deployment or E2E testing
86+
87+
**Use when:**
88+
- Building an NPM package or library
89+
- Creating GitHub Actions
90+
- Building CLI tools
91+
- Working on monorepo shared packages
92+
- Any project without a hosted deployment
93+
94+
---
95+
96+
## Configuration Reference
97+
98+
### Basic CI Options
99+
100+
```yaml
101+
ci:
102+
basic:
103+
enabled: true # Master toggle for basic CI
104+
lint: true # ESLint checks
105+
typecheck: true # TypeScript compilation
106+
vitest: true # Unit/integration tests
107+
```
108+
109+
### E2E Testing Options
110+
111+
```yaml
112+
ci:
113+
e2e:
114+
enabled: true # Master toggle for E2E
115+
framework: playwright # Testing framework
116+
wait_for_deployment: true # Wait for preview before testing
117+
```
118+
119+
### Review Options
120+
121+
```yaml
122+
ci:
123+
reviews:
124+
enabled: true # Master toggle for AI reviews
125+
requirements: true # Check against REQUIREMENTS.md
126+
rules: true # Enforce .claude/rules/
127+
project_memory: true # Use CLAUDE.md context
128+
agents: true # Multi-agent review
129+
skills: true # Specialized skills
130+
playwright_ui: true # Visual UI review
131+
```
132+
133+
### Deployment Options
134+
135+
```yaml
136+
ci:
137+
deployment:
138+
enabled: true
139+
vercel:
140+
enabled: true # Vercel integration
141+
supabase:
142+
enabled: false # Supabase integration
143+
cloudflare:
144+
enabled: false # Cloudflare Pages integration
145+
```
146+
147+
## Customization Tips
148+
149+
### Disabling Specific Checks
150+
151+
If your project doesn't use TypeScript:
152+
```yaml
153+
ci:
154+
basic:
155+
typecheck: false
156+
```
157+
158+
### Adding Multiple Deployments
159+
160+
You can enable multiple deployment platforms if needed:
161+
```yaml
162+
ci:
163+
deployment:
164+
enabled: true
165+
vercel:
166+
enabled: true
167+
supabase:
168+
enabled: true
169+
```
170+
171+
### Minimal Configuration
172+
173+
For a minimal setup with just linting:
174+
```yaml
175+
ci:
176+
basic:
177+
enabled: true
178+
lint: true
179+
typecheck: false
180+
vitest: false
181+
e2e:
182+
enabled: false
183+
reviews:
184+
enabled: false
185+
deployment:
186+
enabled: false
187+
```
188+
189+
## Troubleshooting
190+
191+
### E2E tests timing out
192+
- Increase the deployment wait timeout in your workflow
193+
- Ensure `wait_for_deployment: true` is set
194+
195+
### Reviews not running
196+
- Check that `reviews.enabled: true`
197+
- Verify `ANTHROPIC_API_KEY` secret is configured
198+
199+
### Deployment not detected
200+
- Ensure the correct platform is enabled
201+
- Check that required secrets are configured
202+
- Verify your deployment platform's GitHub integration is set up
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# =============================================================================
2+
# CI Configuration Template: Cloudflare Pages
3+
# =============================================================================
4+
#
5+
# Use this template for:
6+
# - Applications deployed to Cloudflare Pages
7+
# - Static sites, SSR apps, or full-stack apps on Cloudflare
8+
# - Projects using Cloudflare Workers or D1 database
9+
# - Apps that want edge-first deployment
10+
#
11+
# To use: Copy this file to your repo root as `.github/ci-config.yml`
12+
#
13+
# Note: Ensure you have CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID configured
14+
# =============================================================================
15+
16+
ci:
17+
# ---------------------------------------------------------------------------
18+
# Basic CI Checks
19+
# ---------------------------------------------------------------------------
20+
# These run on every PR and push to ensure code quality
21+
basic:
22+
enabled: true
23+
lint: true # Run ESLint to catch code issues
24+
typecheck: true # Run TypeScript compiler for type safety
25+
vitest: true # Run unit/integration tests with Vitest
26+
27+
# ---------------------------------------------------------------------------
28+
# End-to-End Testing
29+
# ---------------------------------------------------------------------------
30+
# Playwright tests run against the deployed preview
31+
e2e:
32+
enabled: true
33+
framework: playwright
34+
wait_for_deployment: true # Wait for Cloudflare preview before running tests
35+
36+
# ---------------------------------------------------------------------------
37+
# AI-Powered Code Reviews
38+
# ---------------------------------------------------------------------------
39+
# Claude Code reviews PRs based on configured rules and context
40+
reviews:
41+
enabled: true
42+
requirements: true # Check PR against project requirements
43+
rules: true # Enforce coding standards from .claude/rules/
44+
project_memory: true # Use project context for smarter reviews
45+
agents: true # Enable multi-agent review capabilities
46+
skills: true # Use specialized review skills
47+
playwright_ui: true # AI reviews UI changes via Playwright screenshots
48+
49+
# ---------------------------------------------------------------------------
50+
# Deployment Configuration
51+
# ---------------------------------------------------------------------------
52+
# Configure your deployment platform(s)
53+
deployment:
54+
enabled: true
55+
vercel:
56+
enabled: false # Not using Vercel for this setup
57+
supabase:
58+
enabled: false # Set true if using Supabase backend
59+
cloudflare:
60+
enabled: true # Deploy previews and production to Cloudflare Pages
61+
# Cloudflare Pages will:
62+
# - Create preview deployments for PRs
63+
# - Deploy to production on main branch merges
64+
# - Provide edge-first performance
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# =============================================================================
2+
# CI Configuration Template: Non-Deployable (Library/Actions)
3+
# =============================================================================
4+
#
5+
# Use this template for:
6+
# - NPM packages and libraries
7+
# - GitHub Actions repositories
8+
# - CLI tools and utilities
9+
# - Monorepo shared packages
10+
# - Any project that doesn't deploy to a hosting platform
11+
#
12+
# To use: Copy this file to your repo root as `.github/ci-config.yml`
13+
#
14+
# Note: E2E and UI review are disabled since there's no deployment to test against
15+
# =============================================================================
16+
17+
ci:
18+
# ---------------------------------------------------------------------------
19+
# Basic CI Checks
20+
# ---------------------------------------------------------------------------
21+
# These run on every PR and push to ensure code quality
22+
basic:
23+
enabled: true
24+
lint: true # Run ESLint to catch code issues
25+
typecheck: true # Run TypeScript compiler for type safety
26+
vitest: true # Run unit/integration tests with Vitest
27+
28+
# ---------------------------------------------------------------------------
29+
# End-to-End Testing
30+
# ---------------------------------------------------------------------------
31+
# Disabled for non-deployable projects
32+
e2e:
33+
enabled: false # No deployment means no E2E testing environment
34+
# framework: playwright
35+
# wait_for_deployment: false
36+
37+
# ---------------------------------------------------------------------------
38+
# AI-Powered Code Reviews
39+
# ---------------------------------------------------------------------------
40+
# Claude Code reviews PRs based on configured rules and context
41+
reviews:
42+
enabled: true
43+
requirements: true # Check PR against project requirements
44+
rules: true # Enforce coding standards from .claude/rules/
45+
project_memory: true # Use project context for smarter reviews
46+
agents: true # Enable multi-agent review capabilities
47+
skills: true # Use specialized review skills
48+
playwright_ui: false # No UI review without a deployed preview
49+
50+
# ---------------------------------------------------------------------------
51+
# Deployment Configuration
52+
# ---------------------------------------------------------------------------
53+
# Disabled for non-deployable projects
54+
deployment:
55+
enabled: false # This project is not deployed
56+
# vercel:
57+
# enabled: false
58+
# supabase:
59+
# enabled: false
60+
# cloudflare:
61+
# enabled: false
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# =============================================================================
2+
# CI Configuration Template: Supabase + Vercel
3+
# =============================================================================
4+
#
5+
# Use this template for:
6+
# - Next.js applications with Supabase backend
7+
# - Full-stack apps using Supabase Auth, Database, or Storage
8+
# - Projects requiring both Vercel preview deploys and Supabase migrations
9+
# - Apps with E2E tests that need database seeding
10+
#
11+
# To use: Copy this file to your repo root as `.github/ci-config.yml`
12+
#
13+
# Note: Ensure you have SUPABASE_ACCESS_TOKEN and project secrets configured
14+
# =============================================================================
15+
16+
ci:
17+
# ---------------------------------------------------------------------------
18+
# Basic CI Checks
19+
# ---------------------------------------------------------------------------
20+
# These run on every PR and push to ensure code quality
21+
basic:
22+
enabled: true
23+
lint: true # Run ESLint to catch code issues
24+
typecheck: true # Run TypeScript compiler for type safety
25+
vitest: true # Run unit/integration tests with Vitest
26+
27+
# ---------------------------------------------------------------------------
28+
# End-to-End Testing
29+
# ---------------------------------------------------------------------------
30+
# Playwright tests run against the deployed preview with Supabase
31+
e2e:
32+
enabled: true
33+
framework: playwright
34+
wait_for_deployment: true # Wait for Vercel preview before running tests
35+
36+
# ---------------------------------------------------------------------------
37+
# AI-Powered Code Reviews
38+
# ---------------------------------------------------------------------------
39+
# Claude Code reviews PRs based on configured rules and context
40+
reviews:
41+
enabled: true
42+
requirements: true # Check PR against project requirements
43+
rules: true # Enforce coding standards from .claude/rules/
44+
project_memory: true # Use project context for smarter reviews
45+
agents: true # Enable multi-agent review capabilities
46+
skills: true # Use specialized review skills
47+
playwright_ui: true # AI reviews UI changes via Playwright screenshots
48+
49+
# ---------------------------------------------------------------------------
50+
# Deployment Configuration
51+
# ---------------------------------------------------------------------------
52+
# Configure your deployment platform(s)
53+
deployment:
54+
enabled: true
55+
vercel:
56+
enabled: true # Deploy previews and production to Vercel
57+
supabase:
58+
enabled: true # Enable Supabase migrations and preview branches
59+
# Supabase will:
60+
# - Create preview branches for PR previews
61+
# - Run database migrations automatically
62+
# - Seed test data for E2E tests (if configured)
63+
cloudflare:
64+
enabled: false # Not using Cloudflare for this setup

0 commit comments

Comments
 (0)