mirror of
https://github.com/siderolabs/kres.git
synced 2026-02-05 09:45:35 +01:00
feat: allow disabling helm docs step on gh workflows
Add configuration setting `docsDisabled` to `auto.Helm` kres definition to disable creation of helm docs on GitHub Workflows. Normally creation of helm docs step goes hand in hand with `Check dirty` step to ensure helm docs were created beforehand. However, there is an issue with this step, causing CI to hang. Signed-off-by: Oguz Kilcan <oguz.kilcan@siderolabs.com>
This commit is contained in:
@@ -43,10 +43,11 @@ type CI struct {
|
||||
|
||||
// Helm defines helm settings.
|
||||
type Helm struct {
|
||||
ChartDir string `yaml:"chartDir"`
|
||||
E2EDir string `yaml:"e2eDir"`
|
||||
Template HelmTemplate `yaml:"template"`
|
||||
Enabled bool `yaml:"enabled"`
|
||||
ChartDir string `yaml:"chartDir"`
|
||||
E2EDir string `yaml:"e2eDir"`
|
||||
Template HelmTemplate `yaml:"template"`
|
||||
Enabled bool `yaml:"enabled"`
|
||||
DocsDisabled bool `yaml:"docsDisabled"`
|
||||
}
|
||||
|
||||
// HelmTemplate defines helm template settings.
|
||||
|
||||
@@ -64,6 +64,7 @@ func (builder *builder) DetectHelm() (bool, error) {
|
||||
}
|
||||
|
||||
builder.meta.HelmTemplateFlags = flags
|
||||
builder.meta.HelmDocsDisabled = helm.DocsDisabled
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import (
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/siderolabs/gen/xslices"
|
||||
|
||||
"github.com/siderolabs/kres/internal/config"
|
||||
"github.com/siderolabs/kres/internal/dag"
|
||||
"github.com/siderolabs/kres/internal/output/dockerfile"
|
||||
@@ -245,6 +247,35 @@ func (helm *Build) CompileGitHubWorkflow(output *ghworkflow.Output) error {
|
||||
jobPermissions := ghworkflow.DefaultJobPermissions()
|
||||
jobPermissions["id-token"] = "write"
|
||||
|
||||
jobSteps := []*ghworkflow.JobStep{
|
||||
{
|
||||
Name: "Install Helm",
|
||||
Uses: ghworkflow.ActionRef{
|
||||
Image: fmt.Sprintf("azure/setup-helm@%s", config.HelmSetupActionRef),
|
||||
Comment: "version: " + config.HelmSetupActionVersion,
|
||||
},
|
||||
},
|
||||
cosignInstallStep,
|
||||
loginStep,
|
||||
lintStep,
|
||||
templateStep,
|
||||
unittestPluginInstallStep,
|
||||
unittestStep,
|
||||
schemaStep,
|
||||
docsStep,
|
||||
checkDirtyStep,
|
||||
helmLoginStep,
|
||||
helmReleaseStep,
|
||||
}
|
||||
|
||||
jobSteps = xslices.Filter(jobSteps, func(step *ghworkflow.JobStep) bool {
|
||||
if helm.meta.HelmDocsDisabled && step.Name == "Generate docs" {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
})
|
||||
|
||||
output.AddWorkflow("helm", &ghworkflow.Workflow{
|
||||
Name: "helm",
|
||||
Concurrency: ghworkflow.Concurrency{
|
||||
@@ -269,26 +300,7 @@ func (helm *Build) CompileGitHubWorkflow(output *ghworkflow.Output) error {
|
||||
RunsOn: ghworkflow.NewRunsOnGroupLabel(ghworkflow.GenericRunner, ""),
|
||||
Steps: slices.Concat(
|
||||
ghworkflow.CommonSteps(),
|
||||
[]*ghworkflow.JobStep{
|
||||
{
|
||||
Name: "Install Helm",
|
||||
Uses: ghworkflow.ActionRef{
|
||||
Image: fmt.Sprintf("azure/setup-helm@%s", config.HelmSetupActionRef),
|
||||
Comment: "version: " + config.HelmSetupActionVersion,
|
||||
},
|
||||
},
|
||||
cosignInstallStep,
|
||||
loginStep,
|
||||
lintStep,
|
||||
templateStep,
|
||||
unittestPluginInstallStep,
|
||||
unittestStep,
|
||||
schemaStep,
|
||||
docsStep,
|
||||
checkDirtyStep,
|
||||
helmLoginStep,
|
||||
helmReleaseStep,
|
||||
},
|
||||
jobSteps,
|
||||
),
|
||||
},
|
||||
},
|
||||
|
||||
@@ -109,6 +109,9 @@ type Options struct { //nolint:govet
|
||||
|
||||
// SOPSEnabled indicates whether SOPS is enabled for the project.
|
||||
SOPSEnabled bool
|
||||
|
||||
// HelmDocsDisabled indicates whether Helm docs should be disabled.
|
||||
HelmDocsDisabled bool
|
||||
}
|
||||
|
||||
// Command defines Golang executable build configuration.
|
||||
|
||||
Reference in New Issue
Block a user