-
Notifications
You must be signed in to change notification settings - Fork 0
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@2d329b54
Includes: * Use CUE v0.10.0 in go:generate steps (we need a better way of driving this). * Define language.version in the repo's CUE module. * Changes to use new multi-step installGo. * Use go1.23.x as the Go version for the repo. Signed-off-by: Paul Jolly <[email protected]> Change-Id: I4f93ebfdea2bc9179c5a66f394499455dc0b93b7 Reviewed-on: https://review.gerrithub.io/c/cue-lang/libcue/+/1200742 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
- Loading branch information
Showing
13 changed files
with
236 additions
and
250 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
File renamed without changes.
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 |
---|---|---|
|
@@ -57,7 +57,13 @@ jobs: | |
uses: actions/setup-go@v5 | ||
with: | ||
cache: false | ||
go-version: 1.21.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.21.x-${{ github.run_id }} | ||
restore-keys: ${{ runner.os }}-1.21.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,14 @@ jobs: | |
path: |- | ||
${{ steps.go-mod-cache-dir.outputs.dir }}/cache/download | ||
${{ steps.go-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-1.21.x-${{ github.run_id }} | ||
restore-keys: ${{ runner.os }}-1.21.x | ||
key: ${{ runner.os }}-1.23.x-${{ github.run_id }} | ||
restore-keys: ${{ runner.os }}-1.23.x | ||
- if: |- | ||
github.repository == 'cue-lang/libcue' && (((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: 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] | ||
- name: Generate | ||
run: go generate ./... | ||
- name: Test | ||
|
File renamed without changes.
Oops, something went wrong.