Compile packages for selected targets
This commit is contained in:
@@ -130,8 +130,9 @@ type ValidationSettings struct {
|
||||
|
||||
// GoValidationSettings selects checks performed by the Go toolchain.
|
||||
type GoValidationSettings struct {
|
||||
Race bool `json:"race,omitempty"`
|
||||
FullVet bool `json:"full_vet,omitempty"`
|
||||
Race bool `json:"race,omitempty"`
|
||||
FullVet bool `json:"full_vet,omitempty"`
|
||||
CompileTargets []string `json:"compile_targets,omitempty"`
|
||||
}
|
||||
|
||||
// DeliverySettings selects the hosted Gitea release destination.
|
||||
@@ -219,6 +220,17 @@ func LoadSettings(repoDir, configPath string) (Settings, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if settings.Validation != nil {
|
||||
for i, target := range settings.Validation.Go.CompileTargets {
|
||||
if strings.Count(target, "/") != 1 {
|
||||
return Settings{}, fmt.Errorf("profile %q: validation.go.compile_targets[%d] must be GOOS/GOARCH", configPath, i)
|
||||
}
|
||||
goos, goarch, _ := strings.Cut(target, "/")
|
||||
if strings.TrimSpace(goos) == "" || strings.TrimSpace(goarch) == "" {
|
||||
return Settings{}, fmt.Errorf("profile %q: validation.go.compile_targets[%d] must be GOOS/GOARCH", configPath, i)
|
||||
}
|
||||
}
|
||||
}
|
||||
return settings, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user