Skip to content

Commit

Permalink
internal/ci: DRY up core based on new base defaults
Browse files Browse the repository at this point in the history
This change should not result in any .github/workflows changes.

Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I10b3923873750b3df8ecf26824ed473cbe5cc131
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/551595
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
  • Loading branch information
myitcv committed Mar 26, 2023
1 parent af02a2c commit 1195b3d
Showing 1 changed file with 12 additions and 45 deletions.
57 changes: 12 additions & 45 deletions internal/ci/core/core.cue
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,21 @@ import (

base

// The machines that we use
githubRepositoryPath: "cue-lang/cue"
unityRepositoryURL: "https://github.com/cue-unity/unity"

defaultBranch: _
releaseBranchPrefix: "release-branch."
releaseBranchPattern: releaseBranchPrefix + "*"
protectedBranchPatterns: [defaultBranch, releaseBranchPattern]

botGitHubUser: "cueckoo"
botGitHubUserEmail: "cueckoo@gmail.com"

linuxMachine: "ubuntu-22.04"
macosMachine: "macos-11"
windowsMachine: "windows-2022"

// Define core URLs that will be used in the codereview.cfg and GitHub workflows
githubRepositoryURL: "https://github.com/cue-lang/cue"
gerritHubHostname: "review.gerrithub.io"
gerritHubRepositoryURL: "https://\(gerritHubHostname)/a/cue-lang/cue"
githubRepositoryPath: "cue-lang/cue"
unityRepositoryURL: "https://github.com/cue-unity/unity"

botGitHubUser: "cueckoo"
botGitHubUserTokenSecretsKey: "CUECKOO_GITHUB_PAT"
botGitHubUserEmail: "cueckoo@gmail.com"
botGerritHubUser: botGitHubUser
botGerritHubUserPasswordSecretsKey: "CUECKOO_GERRITHUB_PASSWORD"
botGerritHubUserEmail: botGitHubUserEmail

// Use the latest Go version for extra checks,
// such as running tests with the data race detector.
latestStableGo: "1.19.x"
Expand All @@ -39,24 +35,6 @@ pinnedReleaseGo: "1.19.7"

goreleaserVersion: "v1.13.1"

defaultBranch: "master"

// releaseBranchPrefix is the git branch name prefix used to identify
// release branches.
releaseBranchPrefix: "release-branch."

// releaseBranchPattern is the GitHub pattern that corresponds to
// releaseBranchPrefix.
releaseBranchPattern: releaseBranchPrefix + "*"

// releaseTagPrefix is the prefix used to identify all git tag that correspond
// to semver releases
releaseTagPrefix: "v"

// releaseTagPattern is the GitHub glob pattern that corresponds to
// releaseTagPrefix.
releaseTagPattern: releaseTagPrefix + "*"

// zeroReleaseTagSuffix is the suffix used to identify all "zero" releases.
// When we create a release branch for v0.$X.0, it's likely that commits on the
// default branch will from that point onwards be intended for the $X+1
Expand All @@ -73,18 +51,7 @@ zeroReleaseTagSuffix: "-0.dev"
// zeroReleaseTagSuffix.
zeroReleaseTagPattern: "*" + zeroReleaseTagSuffix

codeReview: base.#codeReview & {
github: githubRepositoryURL
gerrit: gerritHubRepositoryURL
"cue-unity": unityRepositoryURL
}

// protectedBranchPatterns is a list of glob patterns to match the protected
// git branches which are continuously used during development on Gerrit.
// This includes the default branch and release branches,
// but excludes any others like feature branches or short-lived branches.
// Note that ci/test is excluded as it is GitHub-only.
protectedBranchPatterns: [defaultBranch, releaseBranchPattern]
codeReview: "cue-unity": unityRepositoryURL

// isLatestLinux returns a GitHub expression that evaluates to true if the job
// is running on Linux with the latest version of Go. This expression is often
Expand Down

0 comments on commit 1195b3d

Please sign in to comment.