Documentation
¶
Overview ¶
Package label provides dynamic label parsing for GitHub Actions runner specifications.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Label ¶
type Label struct {
Arch core.Arch `json:"arch"` // CPU architecture (amd64, arm64), defaults to amd64
RAM int64 `json:"ram"` // RAM in megabytes
CPU int64 `json:"cpu"` // CPU cores allocated
}
Label represents resource specifications for runners parsed from a label string. Labels are requested by GitHub Actions jobs via runs-on field.
Format for dynamic labels: cihub-<cpu>cpu-<ram>(mb|gb)[-<arch>] Examples:
- cihub-2cpu-4gb → 2 CPU, 4096 MB RAM, amd64
- cihub-4cpu-8gb-arm64 → 4 CPU, 8192 MB RAM, arm64
- cihub-2cpu-2048mb → 2 CPU, 2048 MB RAM, amd64
func Parse ¶
Parse parses a label string and returns a Label struct. Format: cihub-<cpu>cpu-<ram>(mb|gb)[-<arch>] Examples:
- cihub-2cpu-4gb
- cihub-4cpu-8gb-arm64
- cihub-2cpu-2048mb-amd64
Returns nil if the label doesn't match the cihub- pattern. Returns error if the label matches the pattern but is invalid.
Click to show internal directories.
Click to hide internal directories.