Skip to content

Commit

Permalink
internal/ci: move away from using defs in github
Browse files Browse the repository at this point in the history
Again, we are not defining schemas, only convenience fields (which could
even be lets).

This change should not result in any .github/workflows changes.

Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: Ica0827fcc96410ae3c4efc08afbed48a0dbe822d
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/551593
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 d7a1740 commit 7a7ca81
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions internal/ci/github/release.cue
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"github.com/SchemaStore/schemastore/src/schemas/json"
)

// _#cueVersionRef is a workflow job-runtime expression that evaluates to the
// _cueVersionRef is a workflow job-runtime expression that evaluates to the
// git tag (version) that is being released. Defining as a "constant" here for
// re-use below
_#cueVersionRef: "${GITHUB_REF##refs/tags/}"
_cueVersionRef: "${GITHUB_REF##refs/tags/}"

// The release workflow
workflows: release: core.bashWorkflow & {
Expand Down Expand Up @@ -90,20 +90,20 @@ workflows: release: core.bashWorkflow & {
if: core.isReleaseTag
#repositoryURL: "https://github.com/cue-lang/cuelang.org"
#arg: {
event_type: "Re-test post release of \(_#cueVersionRef)"
event_type: "Re-test post release of \(_cueVersionRef)"
}
},
core.repositoryDispatch & {
name: "Trigger unity build"
if: core.isReleaseTag
#repositoryURL: core.unityRepositoryURL
#arg: {
event_type: "Check against CUE \(_#cueVersionRef)"
event_type: "Check against CUE \(_cueVersionRef)"
client_payload: {
type: "unity"
payload: {
versions: """
"\(_#cueVersionRef)"
"\(_cueVersionRef)"
"""
}
}
Expand Down
24 changes: 12 additions & 12 deletions internal/ci/github/trybot.cue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ workflows: trybot: core.bashWorkflow & {

jobs: {
test: {
strategy: _#testStrategy
strategy: _testStrategy
"runs-on": "${{ matrix.os }}"

let goCaches = core.setupGoActionsCaches & {#protectedBranchExpr: core.isProtectedBranch, _}
Expand Down Expand Up @@ -68,29 +68,29 @@ workflows: trybot: core.bashWorkflow & {
if: "\(core.isProtectedBranch) || \(core.isLatestLinux)"
run: "echo CUE_LONG=true >> $GITHUB_ENV"
},
_#goGenerate,
_#goTest & {
_goGenerate,
_goTest & {
if: "\(core.isProtectedBranch) || !\(core.isLatestLinux)"
},
_#goTestRace & {
_goTestRace & {
if: core.isLatestLinux
},
_#goCheck,
_goCheck,
core.checkGitClean,
_#pullThroughProxy,
_pullThroughProxy,
]
}
}

_#testStrategy: {
_testStrategy: {
"fail-fast": false
matrix: {
"go-version": ["1.18.x", core.latestStableGo]
os: [core.linuxMachine, core.macosMachine, core.windowsMachine]
}
}

_#pullThroughProxy: json.#step & {
_pullThroughProxy: json.#step & {
name: "Pull this commit through the proxy on \(core.defaultBranch)"
run: """
v=$(git rev-parse HEAD)
Expand Down Expand Up @@ -126,20 +126,20 @@ workflows: trybot: core.bashWorkflow & {
if: "\(core.isProtectedBranch) && \(core.isLatestLinux)"
}

_#goGenerate: json.#step & {
_goGenerate: json.#step & {
name: "Generate"
run: "go generate ./..."
// The Go version corresponds to the precise version specified in
// the matrix. Skip windows for now until we work out why re-gen is flaky
if: core.isLatestLinux
}

_#goTest: json.#step & {
_goTest: json.#step & {
name: "Test"
run: "go test ./..."
}

_#goCheck: json.#step & {
_goCheck: json.#step & {
// These checks can vary between platforms, as different code can be built
// based on GOOS and GOARCH build tags.
// However, CUE does not have any such build tags yet, and we don't use
Expand All @@ -151,7 +151,7 @@ workflows: trybot: core.bashWorkflow & {
run: "go vet ./..."
}

_#goTestRace: json.#step & {
_goTestRace: json.#step & {
name: "Test with -race"
run: "go test -race ./..."
}
Expand Down

0 comments on commit 7a7ca81

Please sign in to comment.