Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
507 changes: 507 additions & 0 deletions .github/actions/consolidate-comment/action.yml

Large diffs are not rendered by default.

202 changes: 202 additions & 0 deletions .github/templates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
# CI Configuration Templates

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.

## Quick Start

1. Choose the appropriate template for your project type
2. Copy the template to your repository root as `.github/ci-config.yml`
3. Customize any settings as needed
4. Commit and push to enable the CI pipeline

```bash
# Example: Copy the Vercel template
cp .github/templates/template-vercel.yml .github/ci-config.yml
```

## Available Templates

### template-vercel.yml

**Best for:** Next.js applications deployed to Vercel

**Features:**
- Full basic CI (lint, typecheck, vitest)
- Playwright E2E tests against Vercel previews
- AI-powered code reviews with UI screenshot analysis
- Vercel deployment integration

**Use when:**
- Building a Next.js or React application
- Deploying frontend to Vercel
- Want AI to review UI changes visually

---

### template-supabase-vercel.yml

**Best for:** Full-stack apps with Supabase backend and Vercel frontend

**Features:**
- Everything in template-vercel.yml
- Supabase preview branches for PRs
- Database migration automation
- E2E tests with database access

**Use when:**
- Using Supabase for authentication, database, or storage
- Need isolated database environments for PR previews
- Running E2E tests that require database seeding

**Required secrets:**
- `SUPABASE_ACCESS_TOKEN`
- `SUPABASE_PROJECT_ID` (or configured per-environment)

---

### template-cloudflare.yml

**Best for:** Applications deployed to Cloudflare Pages

**Features:**
- Full basic CI (lint, typecheck, vitest)
- Playwright E2E tests against Cloudflare previews
- AI-powered code reviews with UI screenshot analysis
- Cloudflare Pages deployment integration

**Use when:**
- Deploying to Cloudflare Pages
- Using Cloudflare Workers or D1
- Want edge-first performance

**Required secrets:**
- `CLOUDFLARE_API_TOKEN`
- `CLOUDFLARE_ACCOUNT_ID`

---

### template-non-deployable.yml

**Best for:** Libraries, GitHub Actions, CLI tools, and packages

**Features:**
- Full basic CI (lint, typecheck, vitest)
- AI-powered code reviews (no UI review)
- No deployment or E2E testing

**Use when:**
- Building an NPM package or library
- Creating GitHub Actions
- Building CLI tools
- Working on monorepo shared packages
- Any project without a hosted deployment

---

## Configuration Reference

### Basic CI Options

```yaml
ci:
basic:
enabled: true # Master toggle for basic CI
lint: true # ESLint checks
typecheck: true # TypeScript compilation
vitest: true # Unit/integration tests
```

### E2E Testing Options

```yaml
ci:
e2e:
enabled: true # Master toggle for E2E
framework: playwright # Testing framework
wait_for_deployment: true # Wait for preview before testing
```

### Review Options

```yaml
ci:
reviews:
enabled: true # Master toggle for AI reviews
requirements: true # Check against REQUIREMENTS.md
rules: true # Enforce .claude/rules/
project_memory: true # Use CLAUDE.md context
agents: true # Multi-agent review
skills: true # Specialized skills
playwright_ui: true # Visual UI review
```

### Deployment Options

```yaml
ci:
deployment:
enabled: true
vercel:
enabled: true # Vercel integration
supabase:
enabled: false # Supabase integration
cloudflare:
enabled: false # Cloudflare Pages integration
```

## Customization Tips

### Disabling Specific Checks

If your project doesn't use TypeScript:
```yaml
ci:
basic:
typecheck: false
```

### Adding Multiple Deployments

You can enable multiple deployment platforms if needed:
```yaml
ci:
deployment:
enabled: true
vercel:
enabled: true
supabase:
enabled: true
```

### Minimal Configuration

For a minimal setup with just linting:
```yaml
ci:
basic:
enabled: true
lint: true
typecheck: false
vitest: false
e2e:
enabled: false
reviews:
enabled: false
deployment:
enabled: false
```

## Troubleshooting

### E2E tests timing out
- Increase the deployment wait timeout in your workflow
- Ensure `wait_for_deployment: true` is set

### Reviews not running
- Check that `reviews.enabled: true`
- Verify `ANTHROPIC_API_KEY` secret is configured

### Deployment not detected
- Ensure the correct platform is enabled
- Check that required secrets are configured
- Verify your deployment platform's GitHub integration is set up
64 changes: 64 additions & 0 deletions .github/templates/template-cloudflare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# =============================================================================
# CI Configuration Template: Cloudflare Pages
# =============================================================================
#
# Use this template for:
# - Applications deployed to Cloudflare Pages
# - Static sites, SSR apps, or full-stack apps on Cloudflare
# - Projects using Cloudflare Workers or D1 database
# - Apps that want edge-first deployment
#
# To use: Copy this file to your repo root as `.github/ci-config.yml`
#
# Note: Ensure you have CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID configured
# =============================================================================

ci:
# ---------------------------------------------------------------------------
# Basic CI Checks
# ---------------------------------------------------------------------------
# These run on every PR and push to ensure code quality
basic:
enabled: true
lint: true # Run ESLint to catch code issues
typecheck: true # Run TypeScript compiler for type safety
vitest: true # Run unit/integration tests with Vitest

# ---------------------------------------------------------------------------
# End-to-End Testing
# ---------------------------------------------------------------------------
# Playwright tests run against the deployed preview
e2e:
enabled: true
framework: playwright
wait_for_deployment: true # Wait for Cloudflare preview before running tests

# ---------------------------------------------------------------------------
# AI-Powered Code Reviews
# ---------------------------------------------------------------------------
# Claude Code reviews PRs based on configured rules and context
reviews:
enabled: true
requirements: true # Check PR against project requirements
rules: true # Enforce coding standards from .claude/rules/
project_memory: true # Use project context for smarter reviews
agents: true # Enable multi-agent review capabilities
skills: true # Use specialized review skills
playwright_ui: true # AI reviews UI changes via Playwright screenshots

# ---------------------------------------------------------------------------
# Deployment Configuration
# ---------------------------------------------------------------------------
# Configure your deployment platform(s)
deployment:
enabled: true
vercel:
enabled: false # Not using Vercel for this setup
supabase:
enabled: false # Set true if using Supabase backend
cloudflare:
enabled: true # Deploy previews and production to Cloudflare Pages
# Cloudflare Pages will:
# - Create preview deployments for PRs
# - Deploy to production on main branch merges
# - Provide edge-first performance
61 changes: 61 additions & 0 deletions .github/templates/template-non-deployable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# =============================================================================
# CI Configuration Template: Non-Deployable (Library/Actions)
# =============================================================================
#
# Use this template for:
# - NPM packages and libraries
# - GitHub Actions repositories
# - CLI tools and utilities
# - Monorepo shared packages
# - Any project that doesn't deploy to a hosting platform
#
# To use: Copy this file to your repo root as `.github/ci-config.yml`
#
# Note: E2E and UI review are disabled since there's no deployment to test against
# =============================================================================

ci:
# ---------------------------------------------------------------------------
# Basic CI Checks
# ---------------------------------------------------------------------------
# These run on every PR and push to ensure code quality
basic:
enabled: true
lint: true # Run ESLint to catch code issues
typecheck: true # Run TypeScript compiler for type safety
vitest: true # Run unit/integration tests with Vitest

# ---------------------------------------------------------------------------
# End-to-End Testing
# ---------------------------------------------------------------------------
# Disabled for non-deployable projects
e2e:
enabled: false # No deployment means no E2E testing environment
# framework: playwright
# wait_for_deployment: false

# ---------------------------------------------------------------------------
# AI-Powered Code Reviews
# ---------------------------------------------------------------------------
# Claude Code reviews PRs based on configured rules and context
reviews:
enabled: true
requirements: true # Check PR against project requirements
rules: true # Enforce coding standards from .claude/rules/
project_memory: true # Use project context for smarter reviews
agents: true # Enable multi-agent review capabilities
skills: true # Use specialized review skills
playwright_ui: false # No UI review without a deployed preview

# ---------------------------------------------------------------------------
# Deployment Configuration
# ---------------------------------------------------------------------------
# Disabled for non-deployable projects
deployment:
enabled: false # This project is not deployed
# vercel:
# enabled: false
# supabase:
# enabled: false
# cloudflare:
# enabled: false
64 changes: 64 additions & 0 deletions .github/templates/template-supabase-vercel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# =============================================================================
# CI Configuration Template: Supabase + Vercel
# =============================================================================
#
# Use this template for:
# - Next.js applications with Supabase backend
# - Full-stack apps using Supabase Auth, Database, or Storage
# - Projects requiring both Vercel preview deploys and Supabase migrations
# - Apps with E2E tests that need database seeding
#
# To use: Copy this file to your repo root as `.github/ci-config.yml`
#
# Note: Ensure you have SUPABASE_ACCESS_TOKEN and project secrets configured
# =============================================================================

ci:
# ---------------------------------------------------------------------------
# Basic CI Checks
# ---------------------------------------------------------------------------
# These run on every PR and push to ensure code quality
basic:
enabled: true
lint: true # Run ESLint to catch code issues
typecheck: true # Run TypeScript compiler for type safety
vitest: true # Run unit/integration tests with Vitest

# ---------------------------------------------------------------------------
# End-to-End Testing
# ---------------------------------------------------------------------------
# Playwright tests run against the deployed preview with Supabase
e2e:
enabled: true
framework: playwright
wait_for_deployment: true # Wait for Vercel preview before running tests

# ---------------------------------------------------------------------------
# AI-Powered Code Reviews
# ---------------------------------------------------------------------------
# Claude Code reviews PRs based on configured rules and context
reviews:
enabled: true
requirements: true # Check PR against project requirements
rules: true # Enforce coding standards from .claude/rules/
project_memory: true # Use project context for smarter reviews
agents: true # Enable multi-agent review capabilities
skills: true # Use specialized review skills
playwright_ui: true # AI reviews UI changes via Playwright screenshots

# ---------------------------------------------------------------------------
# Deployment Configuration
# ---------------------------------------------------------------------------
# Configure your deployment platform(s)
deployment:
enabled: true
vercel:
enabled: true # Deploy previews and production to Vercel
supabase:
enabled: true # Enable Supabase migrations and preview branches
# Supabase will:
# - Create preview branches for PR previews
# - Run database migrations automatically
# - Seed test data for E2E tests (if configured)
cloudflare:
enabled: false # Not using Cloudflare for this setup
Loading
Loading