Skip to content

Commit 37c6871

Browse files
committed
internal/ci: modernise CI based on upstream CUE 86ef530e
* "Vendor" the base CI files from 86ef530e in upstream CUE * Switches to uses setup-cue as part of the trybots, rather than hard-coding a 'go run cuelang.org/go/cmd/cue' step. Use latest version of CUE in this install step. * Use cue.dev officially curated github actions, and make corresponding simplifications in usage sites. * Remove now defunct vendor of jsonschema-imported schema, as well as vendoring tooling. * Output differences mainly ordering related, save the change in version of CUE that is installed. Signed-off-by: Paul Jolly <[email protected]> Change-Id: Ib91f360280b1115be6a1e773c10eaac0b6d3e06a Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue-api-java/+/1216783 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Jonathan Matthews <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
1 parent b9b5eb5 commit 37c6871

File tree

14 files changed

+111
-1057
lines changed

14 files changed

+111
-1057
lines changed

.github/workflows/evict_caches.yaml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ name: Evict caches
66
- cron: 0 2 * * *
77
jobs:
88
test:
9-
if: ${{github.repository == 'cue-lang/cue-api-java'}}
10-
runs-on: ubuntu-22.04
119
defaults:
1210
run:
13-
shell: bash
11+
shell: bash --noprofile --norc -euo pipefail {0}
12+
if: ${{github.repository == 'cue-lang/cue-api-java'}}
13+
runs-on: ubuntu-22.04
1414
steps:
1515
- name: Checkout code
1616
uses: actions/checkout@v4
@@ -48,20 +48,11 @@ jobs:
4848
false
4949
- name: Delete caches
5050
run: |-
51-
set -x
52-
5351
echo ${{ secrets.CUECKOO_GITHUB_PAT }} | gh auth login --with-token
54-
gh extension install actions/gh-actions-cache
5552
for i in https://github.com/cue-lang/cue-api-java https://github.com/cue-lang/cue-api-java-trybot
5653
do
5754
echo "Evicting caches for $i"
58-
cd $(mktemp -d)
59-
git init -b initialbranch
60-
git remote add origin $i
61-
for j in $(gh actions-cache list -L 100 | grep refs/ | awk '{print $1}')
62-
do
63-
gh actions-cache delete --confirm $j
64-
done
55+
gh cache delete --repo $i --all --succeed-on-no-caches
6556
done
6657
- name: Trigger workflow runs to repopulate caches
6758
run: |-

.github/workflows/push_tip_to_trybot.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
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
83
concurrency: push_tip_to_trybot
94
jobs:
105
push:
11-
runs-on: ubuntu-22.04
126
defaults:
137
run:
14-
shell: bash
8+
shell: bash --noprofile --norc -euo pipefail {0}
9+
runs-on: ubuntu-22.04
1510
if: ${{github.repository == 'cue-lang/cue-api-java'}}
1611
steps:
1712
- name: Write netrc file for cueckoo Gerrithub
@@ -48,3 +43,8 @@ jobs:
4843
echo "Giving up"
4944
exit 1
5045
fi
46+
name: Push tip to trybot
47+
"on":
48+
push:
49+
branches:
50+
- main

.github/workflows/trybot.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ name: TryBot
1010
workflow_dispatch: {}
1111
jobs:
1212
test:
13+
defaults:
14+
run:
15+
shell: bash --noprofile --norc -euo pipefail {0}
1316
strategy:
1417
fail-fast: false
1518
matrix:
@@ -19,9 +22,6 @@ jobs:
1922
- ubuntu-22.04
2023
- macos-14
2124
runs-on: ${{ matrix.runner }}
22-
defaults:
23-
run:
24-
shell: bash
2525
if: |-
2626
(contains(github.event.head_commit.message, '
2727
Dispatch-Trailer: {"type":"trybot"')) || ! (contains(github.event.head_commit.message, '
@@ -107,6 +107,10 @@ jobs:
107107
github.repository == 'cue-lang/cue-api-java' && (((github.ref == 'refs/heads/main') && (! (contains(github.event.head_commit.message, '
108108
Dispatch-Trailer: {"type":"')))) || github.ref == 'refs/heads/ci/test')
109109
run: go clean -testcache
110+
- name: Install CUE
111+
uses: cue-lang/[email protected]
112+
with:
113+
version: latest
110114
- name: Checkout libcue
111115
uses: actions/checkout@v4
112116
with:
@@ -121,10 +125,10 @@ jobs:
121125
- name: Early git and code sanity checks
122126
run: go run cuelang.org/go/internal/ci/[email protected]
123127
- name: Test
124-
run: mvn clean install package
125128
env:
126129
LD_LIBRARY_PATH: ${{ github.workspace }}/libcue
127130
DYLD_LIBRARY_PATH: ${{ github.workspace }}/libcue
131+
run: mvn clean install package
128132
- name: go generate
129133
run: go generate ./...
130134
- if: always()

.github/workflows/trybot_dispatch.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ name: Dispatch trybot
88
- ci/test
99
jobs:
1010
trybot:
11-
runs-on: ubuntu-22.04
1211
defaults:
1312
run:
14-
shell: bash
13+
shell: bash --noprofile --norc -euo pipefail {0}
14+
runs-on: ubuntu-22.04
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

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

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

cue.mod/module.cue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,9 @@ module: "github.com/cue-lang/cue-api-java"
22
language: {
33
version: "v0.8.0"
44
}
5+
deps: {
6+
"cue.dev/x/githubactions@v0": {
7+
v: "v0.1.0"
8+
default: true
9+
}
10+
}

0 commit comments

Comments
 (0)