ci

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ci holds regression tests for the parts of the GitHub Actions workflows that decide which end-to-end suites run and which images get built for them. That decision is made in YAML and shell rather than in Go, so it is otherwise untested: a renamed output or a dropped "with:" entry silently turns an opt-in suite into a suite that is never selected, or into one selected without the image it needs.

The helpers here read the real workflow files from the repository, so the tests fail when the workflows change rather than when a copy of them does.

Index

Constants

View Source
const (
	PRE2ETestingWorkflow     = "pr-e2e-testing.yaml"
	RunE2ETestsWorkflow      = "run-e2e-tests.yaml"
	BuildImagesChartWorkflow = "build-images-and-charts.yaml"
)

Workflow paths, relative to this package's directory.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	Description string `yaml:"description"`
	Required    bool   `yaml:"required"`
	Type        string `yaml:"type"`
	Default     any    `yaml:"default"`
}

Input is one workflow_call input declaration.

type Job

type Job struct {
	Uses    string            `yaml:"uses"`
	If      string            `yaml:"if"`
	Needs   yaml.Node         `yaml:"needs"`
	With    map[string]any    `yaml:"with"`
	Outputs map[string]string `yaml:"outputs"`
	Steps   []Step            `yaml:"steps"`
}

Job is one workflow job, whether it runs steps or calls another workflow.

func (Job) Step

func (j Job) Step(idOrName string) (Step, bool)

Step returns the first step of a job whose id, or failing that whose name, matches. Steps are identified by id where one exists because a name is prose and gets reworded.

func (Job) WithValue

func (j Job) WithValue(key string) (string, bool)

With returns a "with:" value rendered as the string the workflow file holds, so an expression is compared as written.

type Step

type Step struct {
	Name string            `yaml:"name"`
	ID   string            `yaml:"id"`
	If   string            `yaml:"if"`
	Uses string            `yaml:"uses"`
	Run  string            `yaml:"run"`
	Env  map[string]string `yaml:"env"`
}

Step is one step of a workflow job. Only the fields these tests assert on are modelled; everything else in the file is ignored.

type Workflow

type Workflow struct {
	Name string `yaml:"name"`
	On   struct {
		WorkflowCall struct {
			Inputs map[string]Input `yaml:"inputs"`
		} `yaml:"workflow_call"`
	} `yaml:"on"`
	Jobs map[string]Job `yaml:"jobs"`
}

Workflow is the subset of a workflow file these tests read.

func LoadWorkflow

func LoadWorkflow(name string) (*Workflow, error)

LoadWorkflow reads and parses a workflow from .github/workflows.

func (*Workflow) Job

func (w *Workflow) Job(name string) (Job, bool)

Job returns a named job.

Jump to

Keyboard shortcuts

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