Skip to content

Commit 82eb438

Browse files
committed
internal/ci: re-baseline base from cue-lang/cue@2d329b54
Includes: * Delete unused cue.mod directory at the repo root. * Define language.version in internal/ci's CUE module. * Use CUE v0.10.0 in go:generate steps (we need a better way of driving this). * Changes to use new multi-step installGo. * Use go1.22.x as the Go version for the repo. Signed-off-by: Paul Jolly <[email protected]> Change-Id: I257e063fdb2893d363a0e6dc5dcfaa8c6a63c341 Reviewed-on: https://review.gerrithub.io/c/cue-labs/oci/+/1200748 TryBot-Result: CUE porcuepine <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
1 parent a32ad29 commit 82eb438

File tree

15 files changed

+244
-1172
lines changed

15 files changed

+244
-1172
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
echo Latest commit: $sha
9090
9191
echo "Trigger workflow on cue-labs/oci"
92-
curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PORCUEPINE_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail-with-body -X POST https://api.github.com/repos/cue-labs/oci/actions/workflows/trybot.yml/dispatches -d "{\"ref\":\"$j\"}"
92+
curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PORCUEPINE_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail-with-body -X POST https://api.github.com/repos/cue-labs/oci/actions/workflows/trybot.yaml/dispatches -d "{\"ref\":\"$j\"}"
9393
9494
# Ensure that the trybot repo has the latest commit for
9595
# this branch. If the force-push results in a commit
@@ -121,7 +121,7 @@ jobs:
121121
# We are up-to-date, i.e. the push did nothing, hence we need to trigger a workflow_dispatch
122122
# in the trybot repo.
123123
echo "Trigger workflow on cue-labs/oci-trybot"
124-
curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PORCUEPINE_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail-with-body -X POST https://api.github.com/repos/cue-labs/oci-trybot/actions/workflows/trybot.yml/dispatches -d "{\"ref\":\"$j\"}"
124+
curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PORCUEPINE_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail-with-body -X POST https://api.github.com/repos/cue-labs/oci-trybot/actions/workflows/trybot.yaml/dispatches -d "{\"ref\":\"$j\"}"
125125
else
126126
echo "Force-push to cue-labs/oci-trybot did work; nothing to do"
127127
fi
Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,13 @@ jobs:
5757
uses: actions/setup-go@v5
5858
with:
5959
cache: false
60-
go-version: 1.21.x
60+
go-version: 1.22.x
61+
- name: Set common go env vars
62+
run: |-
63+
go env -w GOTOOLCHAIN=local
64+
65+
# Dump env for good measure
66+
go env
6167
- id: go-mod-cache-dir
6268
name: Get go mod cache directory
6369
run: echo "dir=$(go env GOMODCACHE)" >> ${GITHUB_OUTPUT}
@@ -72,8 +78,8 @@ jobs:
7278
path: |-
7379
${{ steps.go-mod-cache-dir.outputs.dir }}/cache/download
7480
${{ steps.go-cache-dir.outputs.dir }}
75-
key: ${{ runner.os }}-1.21.x-${{ github.run_id }}
76-
restore-keys: ${{ runner.os }}-1.21.x
81+
key: ${{ runner.os }}-1.22.x-${{ github.run_id }}
82+
restore-keys: ${{ runner.os }}-1.22.x
7783
- if: |-
7884
! (((github.ref == 'refs/heads/main') && (! (contains(github.event.head_commit.message, '
7985
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test'))
@@ -82,50 +88,14 @@ jobs:
8288
path: |-
8389
${{ steps.go-mod-cache-dir.outputs.dir }}/cache/download
8490
${{ steps.go-cache-dir.outputs.dir }}
85-
key: ${{ runner.os }}-1.21.x-${{ github.run_id }}
86-
restore-keys: ${{ runner.os }}-1.21.x
91+
key: ${{ runner.os }}-1.22.x-${{ github.run_id }}
92+
restore-keys: ${{ runner.os }}-1.22.x
8793
- if: |-
8894
github.repository == 'cue-labs/oci' && (((github.ref == 'refs/heads/main') && (! (contains(github.event.head_commit.message, '
8995
Dispatch-Trailer: {"type":"')))) || github.ref == 'refs/heads/ci/test')
9096
run: go clean -testcache
9197
- name: Early git and code sanity checks
92-
run: |-
93-
# Ensure that commit messages have a blank second line.
94-
# We know that a commit message must be longer than a single
95-
# line because each commit must be signed-off.
96-
if git log --format=%B -n 1 HEAD | sed -n '2{/^$/{q1}}'; then
97-
echo "second line of commit message must be blank"
98-
exit 1
99-
fi
100-
101-
# All authors, including co-authors, must have a signed-off trailer by email.
102-
# Note that trailers are in the form "Name <email>", so grab the email with sed.
103-
# For now, we require the sorted lists of author and signer emails to match.
104-
# Note that this also fails if a commit isn't signed-off at all.
105-
#
106-
# In Gerrit we already enable a form of this via https://gerrit-review.googlesource.com/Documentation/project-configuration.html#require-signed-off-by,
107-
# but it does not support co-authors nor can it be used when testing GitHub PRs.
108-
commit_authors="$(
109-
{
110-
git log -1 --pretty='%ae'
111-
git log -1 --pretty='%(trailers:key=Co-authored-by,valueonly)' | sed -ne 's/.* <\(.*\)>/\1/p'
112-
} | sort -u
113-
)"
114-
commit_signers="$(
115-
{
116-
git log -1 --pretty='%(trailers:key=Signed-off-by,valueonly)' | sed -ne 's/.* <\(.*\)>/\1/p'
117-
} | sort -u
118-
)"
119-
if [[ "${commit_authors}" != "${commit_signers}" ]]; then
120-
echo "Error: commit author email addresses do not match signed-off-by trailers"
121-
echo
122-
echo "Authors:"
123-
echo "${commit_authors}"
124-
echo
125-
echo "Signers:"
126-
echo "${commit_signers}"
127-
exit 1
128-
fi
98+
run: go run cuelang.org/go/internal/ci/[email protected]
12999
- name: Generate cmd/ocisrv
130100
run: go generate ./...
131101
working-directory: cmd/ocisrv

0 commit comments

Comments
 (0)