validator

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatResult

func FormatResult(result *ValidationResult) string

FormatResult formats a validation result for display

Types

type Job

type Job struct {
	Name  string   // Job name
	Needs []string // Dependencies (needs: [job1, job2])
	Steps []Step   // Steps in the job
}

Job represents a GitHub Actions job

type Step

type Step struct {
	Name string // Step name
	Run  string // Command to run
}

Step represents a GitHub Actions step

type ValidationResult

type ValidationResult struct {
	Pipeline       string   // Pipeline name (e.g., "ci")
	WorkflowFile   string   // Workflow file path
	Success        bool     // Whether validation passed
	MissingInGH    []string // Phases in cidx.toml but not in GitHub workflow
	MissingInLocal []string // Phases in GitHub workflow but not in cidx.toml
	OrderMismatch  bool     // Whether phase order differs
	LocalOrder     []string // Order in cidx.toml
	GitHubOrder    []string // Order in GitHub workflow
}

ValidationResult contains the comparison result between a pipeline and workflow

func ValidateAllWorkflows

func ValidateAllWorkflows(cfg *config.Config, workflowDir string) ([]*ValidationResult, error)

ValidateAllWorkflows validates all pipelines against their corresponding workflows

func ValidateWorkflow

func ValidateWorkflow(cfg *config.Config, pipelineName string, workflowPath string) (*ValidationResult, error)

ValidateWorkflow compares a pipeline definition with a GitHub Actions workflow

type WorkflowDefinition

type WorkflowDefinition struct {
	Name   string         // Workflow name (e.g., "ci", "release")
	File   string         // Workflow file path
	Jobs   map[string]Job // Jobs defined in the workflow
	Phases []string       // Extracted phases from "cidx run <phase>" commands
}

WorkflowDefinition represents a GitHub Actions workflow

func ParseWorkflow

func ParseWorkflow(workflowPath string) (*WorkflowDefinition, error)

ParseWorkflow parses a GitHub Actions workflow file and extracts phase information

type WorkflowJobYAML

type WorkflowJobYAML struct {
	Name  string             `yaml:"name"`
	Needs interface{}        `yaml:"needs"` // Can be string or []string
	Steps []WorkflowStepYAML `yaml:"steps"`
}

WorkflowJobYAML represents a job in the workflow YAML

type WorkflowStepYAML

type WorkflowStepYAML struct {
	Name string `yaml:"name"`
	Run  string `yaml:"run"`
}

WorkflowStepYAML represents a step in a job

type WorkflowYAML

type WorkflowYAML struct {
	Name string                     `yaml:"name"`
	Jobs map[string]WorkflowJobYAML `yaml:"jobs"`
}

WorkflowYAML represents the structure of a GitHub Actions workflow file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL