-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/ci: re-baseline base from cue-lang/cue@c360ba88
Noticed in passing as a result of a now defunct CL 1200735, that this CL will supersede. Includes improvements based on CI setup in cue-lang/vscode-cue, where the presence of cue in PATH is assumed. The setup-cue action is used with a "latest" version. This change moves this repo to be based on the CUE Central Registry for the curated GitHub actions schema. Signed-off-by: Paul Jolly <[email protected]> Change-Id: I10447b2d13dfdbd1fe067a5462fe59e15b1fae8b Reviewed-on: https://review.gerrithub.io/c/cue-lang/proposal/+/1204957 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
- Loading branch information
Showing
18 changed files
with
203 additions
and
1,145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,18 @@ name: TryBot | |
branches: | ||
- ci/test | ||
- main | ||
pull_request: {} | ||
workflow_dispatch: {} | ||
pull_request: {} | ||
jobs: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
defaults: | ||
run: | ||
shell: bash | ||
if: |- | ||
(contains(github.event.head_commit.message, ' | ||
Dispatch-Trailer: {"type":"trybot"')) || ! (contains(github.event.head_commit.message, ' | ||
Dispatch-Trailer: {"type":"')) | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
@@ -57,7 +57,13 @@ jobs: | |
uses: actions/setup-go@v5 | ||
with: | ||
cache: false | ||
go-version: 1.20.x | ||
go-version: 1.23.x | ||
- name: Set common go env vars | ||
run: |- | ||
go env -w GOTOOLCHAIN=local | ||
# Dump env for good measure | ||
go env | ||
- id: go-mod-cache-dir | ||
name: Get go mod cache directory | ||
run: echo "dir=$(go env GOMODCACHE)" >> ${GITHUB_OUTPUT} | ||
|
@@ -72,8 +78,8 @@ jobs: | |
path: |- | ||
${{ steps.go-mod-cache-dir.outputs.dir }}/cache/download | ||
${{ steps.go-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-1.20.x-${{ github.run_id }} | ||
restore-keys: ${{ runner.os }}-1.20.x | ||
key: ${{ runner.os }}-1.23.x-${{ github.run_id }} | ||
restore-keys: ${{ runner.os }}-1.23.x | ||
- if: |- | ||
! (((github.ref == 'refs/heads/main') && (! (contains(github.event.head_commit.message, ' | ||
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) | ||
|
@@ -82,50 +88,21 @@ jobs: | |
path: |- | ||
${{ steps.go-mod-cache-dir.outputs.dir }}/cache/download | ||
${{ steps.go-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-1.20.x-${{ github.run_id }} | ||
restore-keys: ${{ runner.os }}-1.20.x | ||
key: ${{ runner.os }}-1.23.x-${{ github.run_id }} | ||
restore-keys: ${{ runner.os }}-1.23.x | ||
- if: |- | ||
github.repository == 'cue-lang/proposal' && (((github.ref == 'refs/heads/main') && (! (contains(github.event.head_commit.message, ' | ||
Dispatch-Trailer: {"type":"')))) || github.ref == 'refs/heads/ci/test') | ||
run: go clean -testcache | ||
- name: Install CUE | ||
uses: cue-lang/[email protected] | ||
with: | ||
version: latest | ||
- name: Early git and code sanity checks | ||
run: |- | ||
# Ensure that commit messages have a blank second line. | ||
# We know that a commit message must be longer than a single | ||
# line because each commit must be signed-off. | ||
if git log --format=%B -n 1 HEAD | sed -n '2{/^$/{q1}}'; then | ||
echo "second line of commit message must be blank" | ||
exit 1 | ||
fi | ||
# All authors, including co-authors, must have a signed-off trailer by email. | ||
# Note that trailers are in the form "Name <email>", so grab the email with sed. | ||
# For now, we require the sorted lists of author and signer emails to match. | ||
# Note that this also fails if a commit isn't signed-off at all. | ||
# | ||
# In Gerrit we already enable a form of this via https://gerrit-review.googlesource.com/Documentation/project-configuration.html#require-signed-off-by, | ||
# but it does not support co-authors nor can it be used when testing GitHub PRs. | ||
commit_authors="$( | ||
{ | ||
git log -1 --pretty='%ae' | ||
git log -1 --pretty='%(trailers:key=Co-authored-by,valueonly)' | sed -ne 's/.* <\(.*\)>/\1/p' | ||
} | sort -u | ||
)" | ||
commit_signers="$( | ||
{ | ||
git log -1 --pretty='%(trailers:key=Signed-off-by,valueonly)' | sed -ne 's/.* <\(.*\)>/\1/p' | ||
} | sort -u | ||
)" | ||
if [[ "${commit_authors}" != "${commit_signers}" ]]; then | ||
echo "Error: commit author email addresses do not match signed-off-by trailers" | ||
echo | ||
echo "Authors:" | ||
echo "${commit_authors}" | ||
echo | ||
echo "Signers:" | ||
echo "${commit_signers}" | ||
exit 1 | ||
fi | ||
run: go run cuelang.org/go/internal/ci/[email protected] | ||
- run: cue login --token=${CUE_TOKEN} | ||
env: | ||
CUE_TOKEN: ${{ secrets.NOTCUECKOO_CUE_TOKEN }} | ||
- name: Generate | ||
run: go generate ./... | ||
- name: Test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Code generated internal/ci/ci_tool.cue; DO NOT EDIT. | ||
|
||
github: https://github.com/cue-lang/proposal | ||
gerrit: https://review.gerrithub.io/a/cue-lang/proposal | ||
github: https://github.com/cue-lang/proposal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
module: "github.com/cue-lang/proposal" | ||
language: version: "v0.8.0" | ||
deps: "github.com/cue-tmp/jsonschema-pub/exp1/githubactions@v0": { | ||
v: "v0.4.0" | ||
default: true | ||
} |
Oops, something went wrong.