Documentation
¶
Index ¶
- func DeepEquals(a, b yaml.Node, partialMatch bool) bool
- func GetDefaultDisplaySuffix(items []string) string
- func GetDisplayStrings(keys []string, item map[string]*yaml.Node) []string
- type Concurrency
- type Cron
- type Environment
- type ImplicitStringArray
- type Input
- type Job
- type JobState
- type JobStatus
- type MatrixJobState
- type On
- type Output
- type Permissions
- type RunsOn
- type Secret
- type Strategy
- type StrategyResult
- type TraceWriter
- type Workflow
- type WorkflowCall
- type WorkflowDispatch
- type WorkflowState
- type WorkflowStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepEquals ¶
DeepEquals compares two yaml.Node values recursively. It supports scalar, mapping and sequence nodes and allows an optional partial match for mappings and sequences.
func GetDefaultDisplaySuffix ¶
GetDefaultDisplaySuffix returns a string like "(foo, bar, baz)". Empty items are ignored. If all items are empty the result is "".
func GetDisplayStrings ¶
GetDisplayStrings implements the LINQ expression:
from displayitem in keys.SelectMany(key => item[key].Traverse(true)) where !(displayitem is SequenceToken || displayitem is MappingToken) select displayitem.ToString()
Types ¶
type Concurrency ¶
type Concurrency struct {
Group string `yaml:"group"`
CancelInProgress bool `yaml:"cancel-in-progress"`
}
func (*Concurrency) UnmarshalYAML ¶
func (c *Concurrency) UnmarshalYAML(node *yaml.Node) error
type Environment ¶
func (*Environment) UnmarshalYAML ¶
func (e *Environment) UnmarshalYAML(node *yaml.Node) error
type ImplicitStringArray ¶
type ImplicitStringArray []string
func (*ImplicitStringArray) UnmarshalYAML ¶
func (a *ImplicitStringArray) UnmarshalYAML(node *yaml.Node) error
type Job ¶
type Job struct {
Needs ImplicitStringArray `yaml:"needs,omitempty"`
Permissions *Permissions `yaml:"permissions,omitempty"`
Strategy yaml.Node `yaml:"strategy,omitempty"`
Name yaml.Node `yaml:"name,omitempty"`
Concurrency yaml.Node `yaml:"concurrency,omitempty"`
// Reusable Workflow
Uses yaml.Node `yaml:"uses,omitempty"`
With yaml.Node `yaml:"with,omitempty"`
Secrets yaml.Node `yaml:"secrets,omitempty"`
// Runner Job
RunsOn yaml.Node `yaml:"runs-on,omitempty"`
Defaults yaml.Node `yaml:"defaults,omitempty"`
TimeoutMinutes yaml.Node `yaml:"timeout-minutes,omitempty"`
Container yaml.Node `yaml:"container,omitempty"`
Services yaml.Node `yaml:"services,omitempty"`
Env yaml.Node `yaml:"env,omitempty"`
Steps []yaml.Node `yaml:"steps,omitempty"`
Outputs yaml.Node `yaml:"outputs,omitempty"`
}
type MatrixJobState ¶
type On ¶
type On struct {
Data map[string]yaml.Node `yaml:"-"`
WorkflowDispatch *WorkflowDispatch `yaml:"workflow_dispatch,omitempty"`
WorkflowCall *WorkflowCall `yaml:"workflow_call,omitempty"`
Schedule []Cron `yaml:"schedule,omitempty"`
}
func (*On) MarshalYAML ¶
type Permissions ¶
func (*Permissions) UnmarshalYAML ¶
func (p *Permissions) UnmarshalYAML(node *yaml.Node) error
type StrategyResult ¶
type StrategyResult struct {
FlatMatrix []map[string]yaml.Node
IncludeMatrix []map[string]yaml.Node
FailFast bool
MaxParallel *float64
MatrixKeys map[string]struct{}
}
StrategyResult holds the result of expanding a strategy. FlatMatrix contains the expanded matrix entries. IncludeMatrix contains entries that were added via include. FailFast indicates whether the job should fail fast. MaxParallel is the maximum parallelism allowed. MatrixKeys is the set of keys present in the matrix.
func ExpandStrategy ¶
func ExpandStrategy(strategy *Strategy, jobTraceWriter TraceWriter) (*StrategyResult, error)
ExpandStrategy expands the given strategy into a flat matrix and include matrix. It mimics the behavior of the C# StrategyUtils. The strategy parameter is expected to be populated from a YAML mapping that follows the GitHub Actions strategy schema.
type TraceWriter ¶
type TraceWriter interface {
Info(format string, args ...interface{})
}
TraceWriter is an interface for logging trace information. Implementations can write to console, file, or any other sink.
type Workflow ¶
type Workflow struct {
On *On `yaml:"on,omitempty"`
Name string `yaml:"name,omitempty"`
Description string `yaml:"description,omitempty"`
RunName yaml.Node `yaml:"run-name,omitempty"`
Permissions *Permissions `yaml:"permissions,omitempty"`
Env yaml.Node `yaml:"env,omitempty"`
Defaults yaml.Node `yaml:"defaults,omitempty"`
Concurrency yaml.Node `yaml:"concurrency,omitempty"` // Two layouts
Jobs map[string]Job `yaml:"jobs,omitempty"`
}
type WorkflowCall ¶
type WorkflowDispatch ¶
type WorkflowState ¶
type WorkflowState struct {
Name string
RunName string
Jobs JobState
StateWorkflowStatus WorkflowStatus
}
type WorkflowStatus ¶
type WorkflowStatus int
const ( WorkflowStatusPending WorkflowStatus = iota WorkflowStatusDependenciesReady WorkflowStatusBlocked WorkflowStatusCompleted )