diff --git a/modules/structs/actions_capabilities.go b/modules/structs/actions_capabilities.go index d6b8661490..2e258047ba 100644 --- a/modules/structs/actions_capabilities.go +++ b/modules/structs/actions_capabilities.go @@ -3,6 +3,16 @@ package structs +import "time" + +// BandwidthInfo holds network bandwidth test results +type BandwidthInfo struct { + DownloadMbps float64 `json:"download_mbps"` + UploadMbps float64 `json:"upload_mbps,omitempty"` + Latency float64 `json:"latency_ms,omitempty"` + TestedAt time.Time `json:"tested_at"` +} + // DiskInfo holds disk space information for a runner type DiskInfo struct { Total uint64 `json:"total_bytes"` @@ -23,6 +33,7 @@ type RunnerCapability struct { Features *CapabilityFeatures `json:"features,omitempty"` Limitations []string `json:"limitations,omitempty"` Disk *DiskInfo `json:"disk,omitempty"` + Bandwidth *BandwidthInfo `json:"bandwidth,omitempty"` } // CapabilityFeatures represents feature support flags diff --git a/options/locale/locale_en-US.json b/options/locale/locale_en-US.json index 2f843ed882..46c6ea0a87 100644 --- a/options/locale/locale_en-US.json +++ b/options/locale/locale_en-US.json @@ -3713,6 +3713,7 @@ "actions.runners.capabilities.disk_total": "total", "actions.runners.capabilities.disk_warning": "Low disk space", "actions.runners.capabilities.disk_critical": "Critical: disk almost full", + "actions.runners.capabilities.bandwidth": "Network Bandwidth", "actions.runs.all_workflows": "All Workflows", "actions.runs.commit": "Commit", "actions.runs.scheduled": "Scheduled", diff --git a/templates/shared/actions/runner_edit.tmpl b/templates/shared/actions/runner_edit.tmpl index be9b3b41b6..29221421ca 100644 --- a/templates/shared/actions/runner_edit.tmpl +++ b/templates/shared/actions/runner_edit.tmpl @@ -115,6 +115,27 @@ {{end}} + {{if .RunnerCapabilities.Bandwidth}} +