Skip to content

Commit 07ac3ec

Browse files
committed
switch to internal/ci/base to switch to cue.gerrithub.io
Change-Id: I960238369003bd89c5e037d986471702c8d27db3 Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue-api-java/+/1226131 Reviewed-by: Paul Jolly <paul@myitcv.io> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
1 parent 67db201 commit 07ac3ec

File tree

12 files changed

+53
-963
lines changed

12 files changed

+53
-963
lines changed

.github/workflows/push_tip_to_trybot.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
# Code generated internal/ci/ci_tool.cue; DO NOT EDIT.
22

3+
name: Push tip to trybot
4+
"on":
5+
push:
6+
branches:
7+
- main
38
concurrency: push_tip_to_trybot
49
jobs:
510
push:
611
defaults:
712
run:
813
shell: bash --noprofile --norc -euo pipefail {0}
9-
runs-on: ubuntu-22.04
14+
runs-on: namespace-profile-linux-amd64;overrides.cache-tag=cue-dispatch-workflow
1015
if: ${{github.repository == 'cue-lang/cue-api-java'}}
1116
steps:
1217
- name: Write netrc file for cueckoo Gerrithub
1318
run: |-
1419
cat <<EOD > ~/.netrc
15-
machine review.gerrithub.io
20+
machine cue.gerrithub.io
1621
login cueckoo
1722
password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }}
1823
EOD
@@ -25,7 +30,7 @@ jobs:
2530
git config user.name cueckoo
2631
git config user.email cueckoo@gmail.com
2732
git config http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)"
28-
git remote add origin https://review.gerrithub.io/a/cue-lang/cue-api-java
33+
git remote add origin https://cue.gerrithub.io/a/cue-lang/cue-api-java
2934
git remote add trybot https://github.com/cue-lang/cue-api-java-trybot
3035
3136
git fetch origin "${{ github.ref }}"
@@ -43,8 +48,3 @@ jobs:
4348
echo "Giving up"
4449
exit 1
4550
fi
46-
name: Push tip to trybot
47-
"on":
48-
push:
49-
branches:
50-
- main

.github/workflows/trybot.yaml

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ name: TryBot
77
- ci/test
88
- main
99
pull_request: {}
10+
schedule:
11+
- cron: 0 2 * * *
1012
workflow_dispatch: {}
1113
jobs:
1214
test:
@@ -19,23 +21,23 @@ jobs:
1921
go-version:
2022
- stable
2123
runner:
22-
- ubuntu-22.04
23-
- macos-14
24+
- namespace-profile-linux-amd64
25+
- ns-macos-arm64
2426
runs-on: ${{ matrix.runner }}
2527
if: |-
2628
(contains(github.event.head_commit.message, '
2729
Dispatch-Trailer: {"type":"trybot"')) || ! (contains(github.event.head_commit.message, '
2830
Dispatch-Trailer: {"type":"'))
2931
steps:
3032
- name: Checkout code
31-
uses: actions/checkout@v4
33+
uses: actions/checkout@v5
3234
with:
3335
ref: ${{ github.event.pull_request.head.sha }}
3436
fetch-depth: 0
3537
- name: Reset git directory modification times
3638
run: touch -t 202211302355 $(find * -type d)
3739
- name: Restore git file modification times
38-
uses: chetan/git-restore-mtime-action@075f9bc9d159805603419d50f794bd9f33252ebe
40+
uses: chetan/git-restore-mtime-action@cbf8161ddb4e9b162409104954fb540e8a38c1da
3941
- id: DispatchTrailer
4042
name: Try to extract Dispatch-Trailer
4143
run: |-
@@ -62,13 +64,16 @@ jobs:
6264
echo "github.event.head_commit.message contains Dispatch-Trailer but we are on a protected branch"
6365
false
6466
- name: Install Go
65-
uses: actions/setup-go@v5
67+
uses: actions/setup-go@v6
6668
with:
6769
cache: false
68-
go-version: ${{ matrix.go-version }}
70+
go-version: 1.25.x
6971
- name: Set common go env vars
7072
run: |-
71-
go env -w GOTOOLCHAIN=local
73+
case $(go env GOARCH) in
74+
amd64) go env -w GOAMD64=v3 ;; # 2013 and later; makes `go test -race` 15% faster
75+
arm64) go env -w GOARM64=v8.6 ;; # Apple M2 and later
76+
esac
7277
7378
# Dump env for good measure
7479
go env
@@ -77,36 +82,14 @@ jobs:
7782
with:
7883
distribution: temurin
7984
java-version: "22"
80-
- id: go-mod-cache-dir
81-
name: Get go mod cache directory
82-
run: echo "dir=$(go env GOMODCACHE)" >> ${GITHUB_OUTPUT}
83-
- id: go-cache-dir
84-
name: Get go build/test cache directory
85-
run: echo "dir=$(go env GOCACHE)" >> ${GITHUB_OUTPUT}
86-
- if: |-
87-
(((github.ref == 'refs/heads/main') && (! (contains(github.event.head_commit.message, '
88-
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test'))
89-
uses: actions/cache@v4
85+
- if: github.event_name != 'schedule' && matrix.runner != 'ns-windows-amd64'
86+
uses: namespacelabs/nscloud-cache-action@v1
9087
with:
91-
path: |-
92-
${{ steps.go-mod-cache-dir.outputs.dir }}/cache/download
93-
${{ steps.go-cache-dir.outputs.dir }}
94-
key: ${{ runner.os }}-${{ matrix.go-version }}-${{ github.run_id }}
95-
restore-keys: ${{ runner.os }}-${{ matrix.go-version }}
96-
- if: |-
97-
! (((github.ref == 'refs/heads/main') && (! (contains(github.event.head_commit.message, '
98-
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test'))
99-
uses: actions/cache/restore@v4
100-
with:
101-
path: |-
102-
${{ steps.go-mod-cache-dir.outputs.dir }}/cache/download
103-
${{ steps.go-cache-dir.outputs.dir }}
104-
key: ${{ runner.os }}-${{ matrix.go-version }}-${{ github.run_id }}
105-
restore-keys: ${{ runner.os }}-${{ matrix.go-version }}
88+
cache: go
10689
- if: |-
10790
github.repository == 'cue-lang/cue-api-java' && (((github.ref == 'refs/heads/main') && (! (contains(github.event.head_commit.message, '
108-
Dispatch-Trailer: {"type":"')))) || github.ref == 'refs/heads/ci/test')
109-
run: go clean -testcache
91+
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test'))
92+
run: go env -w GOFLAGS=-count=1
11093
- name: Install CUE
11194
uses: cue-lang/setup-cue@v1.0.1
11295
with:
@@ -117,13 +100,13 @@ jobs:
117100
repository: cue-lang/libcue
118101
path: libcue
119102
- name: Build libcue
103+
working-directory: libcue
120104
run: |-
121105
go build -o libcue.so -buildmode=c-shared
122106
cp libcue.so libcue.dylib
123107
cp libcue.so cue.dll
124-
working-directory: libcue
125108
- name: Early git and code sanity checks
126-
run: go run cuelang.org/go/internal/ci/checks@v0.11.0-0.dev.0.20240903133435-46fb300df650
109+
run: go run cuelang.org/go/internal/ci/checks@v0.14.1
127110
- name: Test
128111
env:
129112
LD_LIBRARY_PATH: ${{ github.workspace }}/libcue

.github/workflows/trybot_dispatch.yaml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,36 @@ jobs:
1111
defaults:
1212
run:
1313
shell: bash --noprofile --norc -euo pipefail {0}
14-
runs-on: ubuntu-22.04
14+
runs-on: namespace-profile-linux-amd64;overrides.cache-tag=cue-dispatch-workflow
1515
if: ${{ ((github.ref == 'refs/heads/ci/test') && false) || github.event.client_payload.type == 'trybot' }}
1616
steps:
1717
- name: Write netrc file for cueckoo Gerrithub
1818
run: |-
1919
cat <<EOD > ~/.netrc
20-
machine review.gerrithub.io
20+
machine cue.gerrithub.io
2121
login cueckoo
2222
password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }}
2323
EOD
2424
chmod 600 ~/.netrc
25-
- id: payload
25+
- name: Write fake payload
26+
id: payload
2627
if: github.repository == 'cue-lang/cue-api-java' && (github.ref == 'refs/heads/ci/test')
27-
name: Write fake payload
2828
run: |-
2929
cat <<EOD >> $GITHUB_OUTPUT
3030
value<<DOE
3131
null
3232
DOE
3333
EOD
34-
- if: github.event.client_payload.type != 'trybot'
35-
name: Trigger TryBot (fake data)
34+
- name: Trigger TryBot (fake data)
35+
if: github.event.client_payload.type != 'trybot'
3636
run: |-
3737
mkdir tmpgit
3838
cd tmpgit
3939
git init -b initialbranch
4040
git config user.name cueckoo
4141
git config user.email cueckoo@gmail.com
4242
git config http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)"
43-
git remote add origin https://review.gerrithub.io/a/cue-lang/cue-api-java
43+
git remote add origin https://cue.gerrithub.io/a/cue-lang/cue-api-java
4444
4545
git fetch origin ${{ fromJSON(steps.payload.outputs.value).ref }}
4646
git checkout -b local_${{ fromJSON(steps.payload.outputs.value).targetBranch }} FETCH_HEAD
@@ -65,7 +65,10 @@ jobs:
6565
${{ toJSON(fromJSON(steps.payload.outputs.value)) }}
6666
EOD
6767
)"
68-
git log -1 --format=%B | git interpret-trailers --trailer "Dispatch-Trailer: $trailer" | git commit --amend -F -
68+
# --no-divider prevents a "---" line from marking the end of the commit message.
69+
# Here, we know that the input is exactly one commit message,
70+
# so don't do weird things if the commit message has a "---" line.
71+
git log -1 --format=%B | git interpret-trailers --no-divider --trailer "Dispatch-Trailer: $trailer" | git commit --amend -F -
6972
git log -1
7073
7174
success=false
@@ -81,16 +84,16 @@ jobs:
8184
echo "Giving up"
8285
exit 1
8386
fi
84-
- if: github.event.client_payload.type == 'trybot'
85-
name: Trigger TryBot (repository_dispatch payload)
87+
- name: Trigger TryBot (repository_dispatch payload)
88+
if: github.event.client_payload.type == 'trybot'
8689
run: |-
8790
mkdir tmpgit
8891
cd tmpgit
8992
git init -b initialbranch
9093
git config user.name cueckoo
9194
git config user.email cueckoo@gmail.com
9295
git config http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} | base64)"
93-
git remote add origin https://review.gerrithub.io/a/cue-lang/cue-api-java
96+
git remote add origin https://cue.gerrithub.io/a/cue-lang/cue-api-java
9497
9598
git fetch origin ${{ github.event.client_payload.ref }}
9699
git checkout -b local_${{ github.event.client_payload.targetBranch }} FETCH_HEAD
@@ -115,7 +118,10 @@ jobs:
115118
${{ toJSON(github.event.client_payload) }}
116119
EOD
117120
)"
118-
git log -1 --format=%B | git interpret-trailers --trailer "Dispatch-Trailer: $trailer" | git commit --amend -F -
121+
# --no-divider prevents a "---" line from marking the end of the commit message.
122+
# Here, we know that the input is exactly one commit message,
123+
# so don't do weird things if the commit message has a "---" line.
124+
git log -1 --format=%B | git interpret-trailers --no-divider --trailer "Dispatch-Trailer: $trailer" | git commit --amend -F -
119125
git log -1
120126
121127
success=false

codereview.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Code generated internal/ci/ci_tool.cue; DO NOT EDIT.
22

33
github: https://github.com/cue-lang/cue-api-java
4-
gerrit: https://review.gerrithub.io/a/cue-lang/cue-api-java
4+
gerrit: https://cue.gerrithub.io/a/cue-lang/cue-api-java

cue.mod/module.cue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ language: {
44
}
55
deps: {
66
"cue.dev/x/githubactions@v0": {
7-
v: "v0.1.0"
7+
v: "v0.2.0"
88
default: true
99
}
10+
"github.com/cue-lang/tmp/internal/ci@v0": {
11+
v: "v0.0.10"
12+
}
1013
}

internal/ci/base/base.cue

Lines changed: 0 additions & 93 deletions
This file was deleted.

internal/ci/base/codereview.cue

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)