Documentation
¶
Index ¶
- func DefaultWorkflowDir() string
- func Normalize(wf *Workflow) error
- func Validate(wf *Workflow) error
- type Defaults
- type DryRunJob
- type DryRunPlan
- type DryRunPlanSet
- type DryRunStep
- type Job
- func (j *Job) GetMatrixContext() map[string]any
- func (j Job) GetNeedsAsString() string
- func (j Job) GetNeedsList() []string
- func (j *Job) GetRunsOnAsString() string
- func (j *Job) GitHubEnvPath() string
- func (j *Job) GitHubPathPath() string
- func (j *Job) HasMatrix() bool
- func (j *Job) InstanceID() string
- func (j *Job) SetGitHubEnvPath(path string)
- func (j *Job) SetGitHubPathPath(path string)
- func (j *Job) SetInstanceID(id string)
- type MatrixExpansion
- type RunDefaults
- type Service
- type Step
- type Strategy
- type ValidationError
- type ValidationErrorWithCode
- type Workflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultWorkflowDir ¶
func DefaultWorkflowDir() string
DefaultWorkflowDir returns the default workflow directory.
Types ¶
type Defaults ¶
type Defaults struct {
Run *RunDefaults `yaml:"run"`
}
Defaults represents default settings for a job.
type DryRunJob ¶
type DryRunJob struct {
ID string
Name string
RunsOn string
Needs string
If string
Matrix map[string]any
Steps []DryRunStep
}
DryRunJob represents a job in the dry-run plan.
type DryRunPlan ¶
DryRunPlan represents a dry-run execution plan for a single workflow.
func GenerateDryRunPlan ¶
func GenerateDryRunPlan(wf *Workflow, path string) *DryRunPlan
GenerateDryRunPlan generates a dry-run plan from the workflow.
type DryRunPlanSet ¶
type DryRunPlanSet struct {
Plans []*DryRunPlan
}
DryRunPlanSet represents a dry-run execution plan for multiple workflows.
func GenerateDryRunPlanSet ¶
func GenerateDryRunPlanSet(workflows []*Workflow, paths []string) *DryRunPlanSet
GenerateDryRunPlanSet generates a dry-run plan set from multiple workflows.
type DryRunStep ¶
type DryRunStep struct {
Index int
ID string
Name string
Run string
Uses string
If string
ContinueOnError bool
TimeoutMinutes float64
}
DryRunStep represents a step in the dry-run plan.
type Job ¶
type Job struct {
Name string `yaml:"name"`
RunsOn interface{} `yaml:"runs-on"`
Needs interface{} `yaml:"needs"`
If string `yaml:"if"`
Env map[string]any `yaml:"env"`
Services map[string]Service `yaml:"services"`
Steps []Step `yaml:"steps"`
Strategy *Strategy `yaml:"strategy"`
Outputs map[string]string `yaml:"outputs"`
TimeoutMinutes float64 `yaml:"timeout-minutes"`
Defaults *Defaults `yaml:"defaults"`
// contains filtered or unexported fields
}
Job represents a job in a workflow.
func ExpandMatrix ¶
ExpandMatrix expands a matrix configuration into a list of job instances. Each job instance has its own matrix context.
func (*Job) GetMatrixContext ¶
GetMatrixContext returns the matrix context for a job.
func (Job) GetNeedsAsString ¶
GetNeedsAsString returns the needs as a comma-separated string for display.
func (Job) GetNeedsList ¶
GetNeedsList returns the needs as a slice of strings.
func (*Job) GetRunsOnAsString ¶
GetRunsOnAsString returns the runs-on as a comma-separated string for display.
func (*Job) GitHubEnvPath ¶
GitHubEnvPath returns the GITHUB_ENV file path.
func (*Job) GitHubPathPath ¶
GitHubPathPath returns the GITHUB_PATH file path.
func (*Job) SetGitHubEnvPath ¶
SetGitHubEnvPath sets the GITHUB_ENV file path.
func (*Job) SetGitHubPathPath ¶
SetGitHubPathPath sets the GITHUB_PATH file path.
func (*Job) SetInstanceID ¶
SetInstanceID sets the job instance ID.
type MatrixExpansion ¶
MatrixExpansion represents a single expanded matrix combination
type RunDefaults ¶
type RunDefaults struct {
Shell string `yaml:"shell"`
WorkingDirectory string `yaml:"working-directory"`
}
RunDefaults represents default run settings.
type Service ¶
type Service struct {
Image string `yaml:"image"`
Env map[string]any `yaml:"env"`
Ports []any `yaml:"ports"`
Options string `yaml:"options"`
}
Service represents a service container in a job.
type Step ¶
type Step struct {
ID string `yaml:"id"`
Name string `yaml:"name"`
If string `yaml:"if"`
Run string `yaml:"run"`
Uses string `yaml:"uses"`
With map[string]any `yaml:"with"`
Env map[string]any `yaml:"env"`
Shell string `yaml:"shell"`
WorkingDirectory string `yaml:"working-directory"`
ContinueOnError bool `yaml:"continue-on-error"`
TimeoutMinutes float64 `yaml:"timeout-minutes"`
}
Step represents a step in a job.
type Strategy ¶
type Strategy struct {
Matrix map[string]any `yaml:"matrix"`
FailFast bool `yaml:"fail-fast"`
MaxParallel int `yaml:"max-parallel"`
}
Strategy represents the strategy configuration for a job.
type ValidationError ¶
ValidationError represents a validation error with location info.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
type ValidationErrorWithCode ¶
type ValidationErrorWithCode struct {
ValidationError
ExitCode int
}
ValidationErrorWithCode extends ValidationError with an exit code.
func NewValidationErrorWithCode ¶
func NewValidationErrorWithCode(jobID, message string, exitCode int) *ValidationErrorWithCode
NewValidationErrorWithCode creates a validation error with a specific exit code.
func (*ValidationErrorWithCode) Error ¶
func (e *ValidationErrorWithCode) Error() string
type Workflow ¶
type Workflow struct {
Name string `yaml:"name"`
On interface{} `yaml:"on"`
Env map[string]any `yaml:"env"`
Secrets map[string]any `yaml:"secrets"`
Jobs map[string]Job `yaml:"jobs"`
Defaults *Defaults `yaml:"defaults"`
}
Workflow represents a GitHub Actions workflow file.
func ExpandWorkflowJobs ¶
ExpandWorkflowJobs expands matrix jobs in a workflow. Returns a new workflow with expanded jobs.
func LoadWorkflow ¶
LoadWorkflow loads a workflow from a YAML file.
func LoadWorkflows ¶
LoadWorkflows loads all workflow files from a path (file or directory). If path is a file, loads that single file. If path is a directory, loads all .yml and .yaml files in it.