Skip to content

Commit d810f05

Browse files
committed
internal/ci: modernise CI based on upstream CUE 86ef530e
* "Vendor" the base CI files from 86ef530e in upstream CUE * Install the latest version of CUE in CI workflows * 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. Change-Id: I9f599ddd418074a17f81f2a4b4dbef83e580422f Signed-off-by: Paul Jolly <[email protected]> Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue-py/+/1216790 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Jonathan Matthews <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
1 parent 311bba6 commit d810f05

File tree

14 files changed

+110
-1069
lines changed

14 files changed

+110
-1069
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-py'}}
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-py'}}
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-py https://github.com/cue-lang/cue-py-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-py'}}
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: 7 additions & 9 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:
@@ -21,9 +24,6 @@ jobs:
2124
- ubuntu-22.04
2225
- macos-14
2326
runs-on: ${{ matrix.runner }}
24-
defaults:
25-
run:
26-
shell: bash
2727
if: |-
2828
(contains(github.event.head_commit.message, '
2929
Dispatch-Trailer: {"type":"trybot"')) || ! (contains(github.event.head_commit.message, '
@@ -63,9 +63,9 @@ jobs:
6363
run: |-
6464
echo "github.event.head_commit.message contains Dispatch-Trailer but we are on a protected branch"
6565
false
66-
- uses: cue-lang/[email protected].0
66+
- uses: cue-lang/[email protected].1
6767
with:
68-
version: v0.10.0
68+
version: latest
6969
- name: Install Go
7070
uses: actions/setup-go@v5
7171
with:
@@ -80,9 +80,7 @@ jobs:
8080
- name: Early git and code sanity checks
8181
run: go run cuelang.org/go/internal/ci/[email protected]
8282
- name: Re-generate CI
83-
run: |-
84-
cue cmd importjsonschema ./vendor
85-
cue cmd gen
83+
run: cue cmd gen
8684
working-directory: ./internal/ci
8785
- if: always()
8886
name: Check that git is clean at the end of the job
@@ -141,10 +139,10 @@ jobs:
141139
name: Add libcue to PATH
142140
run: echo '${{ github.workspace }}/libcue-checkout' >> $GITHUB_PATH
143141
- name: pytest
144-
run: pytest
145142
env:
146143
LD_LIBRARY_PATH: ${{ github.workspace }}/libcue-checkout
147144
DYLD_LIBRARY_PATH: ${{ github.workspace }}/libcue-checkout
145+
run: pytest
148146
- if: always()
149147
name: Check that git is clean at the end of the job
150148
run: test -z "$(git status --porcelain)" || (git status; git diff; false)

.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-py
43
github: https://github.com/cue-lang/cue-py
4+
gerrit: https://review.gerrithub.io/a/cue-lang/cue-py

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-py"
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)