Skip to content

Commit

Permalink
Bring back explicit postgres ci option for backup-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Oct 10, 2024
1 parent 786ded0 commit 2bcfa3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions internal/core/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ type CIWorkflowConfig struct {
IgnorePaths []string `yaml:"ignorePaths"`
RunnerType []string `yaml:"runOn"`
Coveralls bool `yaml:"coveralls"`
Postgres bool `yaml:"postgres"`
}

// LicenseWorkflowConfig appears in type Configuration.
Expand Down Expand Up @@ -252,6 +253,9 @@ func (c *Configuration) Validate() {

// Validate CI workflow configuration.
if ghwCfg.CI.Enabled {
if !ghwCfg.CI.Postgres {
logg.Fatal("githubWorkflow.ci.enabled must be set to 'true' when githubWorkflow.ci.postgres is enabled")
}
if len(ghwCfg.CI.RunnerType) > 1 && !strings.HasPrefix(ghwCfg.CI.RunnerType[0], "ubuntu") {
logg.Fatal("githubWorkflow.ci.runOn must only define a single Ubuntu based runner when githubWorkflow.ci.postgres is enabled")
}
Expand Down
2 changes: 1 addition & 1 deletion internal/ghworkflow/workflow_ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func ciWorkflow(cfg core.Configuration, sr golang.ScanResult) {

testJob := buildOrTestBaseJob("Test", cfg)
testJob.Needs = []string{"build"}
if sr.UsesPostgres {
if ghwCfg.CI.Postgres || sr.UsesPostgres {
testJob.Services = map[string]jobService{"postgres": {
Image: "postgres:" + core.DefaultPostgresVersion,
Env: map[string]string{"POSTGRES_PASSWORD": "postgres"},
Expand Down

0 comments on commit 2bcfa3a

Please sign in to comment.