Skip to content

Commit

Permalink
internal/ci: re-baseline base from cue-lang/cue@2d329b54
Browse files Browse the repository at this point in the history
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 <paul@myitcv.io>
Change-Id: I4f93ebfdea2bc9179c5a66f394499455dc0b93b7
Reviewed-on: https://review.gerrithub.io/c/cue-lang/libcue/+/1200742
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
  • Loading branch information
myitcv committed Sep 6, 2024
1 parent 1c861cc commit ed27d71
Show file tree
Hide file tree
Showing 13 changed files with 236 additions and 250 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
echo Latest commit: $sha
echo "Trigger workflow on cue-lang/libcue"
curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.CUECKOO_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail-with-body -X POST https://api.github.com/repos/cue-lang/libcue/actions/workflows/trybot.yml/dispatches -d "{\"ref\":\"$j\"}"
curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.CUECKOO_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail-with-body -X POST https://api.github.com/repos/cue-lang/libcue/actions/workflows/trybot.yaml/dispatches -d "{\"ref\":\"$j\"}"
# Ensure that the trybot repo has the latest commit for
# this branch. If the force-push results in a commit
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
# We are up-to-date, i.e. the push did nothing, hence we need to trigger a workflow_dispatch
# in the trybot repo.
echo "Trigger workflow on cue-lang/libcue-trybot"
curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.CUECKOO_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail-with-body -X POST https://api.github.com/repos/cue-lang/libcue-trybot/actions/workflows/trybot.yml/dispatches -d "{\"ref\":\"$j\"}"
curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.CUECKOO_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail-with-body -X POST https://api.github.com/repos/cue-lang/libcue-trybot/actions/workflows/trybot.yaml/dispatches -d "{\"ref\":\"$j\"}"
else
echo "Force-push to cue-lang/libcue-trybot did work; nothing to do"
fi
Expand Down
File renamed without changes.
54 changes: 12 additions & 42 deletions .github/workflows/trybot.yml → .github/workflows/trybot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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'))
Expand All @@ -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/checks@v0.11.0-0.dev.0.20240903133435-46fb300df650
- name: Generate
run: go generate ./...
- name: Test
Expand Down
File renamed without changes.
Loading

0 comments on commit ed27d71

Please sign in to comment.