#!/usr/bin/env node /** * GitHub Actions Workflow Generator Command * * Generates .github/workflows/validate.yml from vibe-validate.config.yaml * Ensures perfect sync between local validation and CI validation. * * Features: * - Reads vibe-validate.config.yaml configuration * - Generates GitHub Actions workflow with proper job dependencies * - Supports multi-OS and multi-Node.js version testing * - Includes coverage reporting integration * - Provides --check mode to verify workflow sync * * @packageDocumentation */ import type { VibeValidateConfig } from '@vibe-validate/config'; import { type Command } from 'commander'; import { type PackageManager } from '../utils/package-manager-commands.js'; /** * Generate GitHub Actions workflow options */ export interface GenerateWorkflowOptions { /** Node.js versions to test (default: auto-detect from package.json engines) */ nodeVersions?: string[]; /** Operating systems to test (default: ['ubuntu-latest']) */ os?: string[]; /** Package manager (default: auto-detect from packageManager field or lockfiles) */ packageManager?: PackageManager; /** Enable coverage reporting (default: false) */ enableCoverage?: boolean; /** Coverage provider (default: 'codecov') */ coverageProvider?: 'codecov' | 'coveralls'; /** Codecov token secret name (default: 'CODECOV_TOKEN') */ codecovTokenSecret?: string; /** Fail fast in matrix (default: false) */ matrixFailFast?: boolean; /** Project root directory for detecting package.json and lockfiles (default: process.cwd()) */ projectRoot?: string; } /** * Convert phase/step name to valid GitHub Actions job ID * (lowercase, replace spaces with dashes, remove special chars) */ export declare function toJobId(name: string): string; /** * Check if the project has a "build" script in package.json * * @param cwd - Project root directory * @returns true if package.json has a scripts.build entry */ export declare function projectHasBuildScript(cwd?: string): boolean; /** * Generate GitHub Actions workflow from validation config * * Always generates a single "validate" job that runs all validation steps * sequentially within one CI runner - matching the local `pnpm validate` experience. * This ensures setup steps (e.g., playwright install) run before tests, and * new checkouts for developers and CI just work. * * Supports matrix strategy for testing across multiple Node.js versions and OS. */ export declare function generateWorkflow(config: VibeValidateConfig, options?: GenerateWorkflowOptions): string; /** * Convert CI config to GenerateWorkflowOptions * * @param config - Full vibe-validate configuration * @returns Workflow options derived from config.ci */ export declare function ciConfigToWorkflowOptions(config: VibeValidateConfig): Partial; /** * Check if workflow file is in sync with validation config * * @param config - Vibe-validate configuration * @param options - Workflow generation options * @param workflowPath - Path to workflow file (defaults to '.github/workflows/validate.yml' for backwards compatibility) */ export declare function checkSync(config: VibeValidateConfig, options?: GenerateWorkflowOptions, workflowPath?: string): { inSync: boolean; diff?: string; }; /** * Main command handler for Commander.js */ export declare function generateWorkflowCommand(program: Command): void; /** * Show verbose help with detailed documentation */ export declare function showGenerateWorkflowVerboseHelp(): void; //# sourceMappingURL=generate-workflow.d.ts.map