-
Notifications
You must be signed in to change notification settings - Fork 8
261 lines (259 loc) · 8.83 KB
/
trybot.yaml
File metadata and controls
261 lines (259 loc) · 8.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# Code generated internal/ci/ci_tool.cue; DO NOT EDIT.
name: TryBot
"on":
push:
branches:
- ci/test
- main
pull_request: {}
schedule:
- cron: 0 2 * * *
workflow_dispatch: {}
jobs:
test:
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
runs-on: namespace-profile-linux-amd64
if: |-
(contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"trybot"')) || ! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"'))
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Reset git directory modification times
run: touch -t 202211302355 $(find * -type d)
- name: Restore git file modification times
uses: chetan/git-restore-mtime-action@cbf8161ddb4e9b162409104954fb540e8a38c1da
- id: DispatchTrailer
name: Try to extract Dispatch-Trailer
run: |-
x="$(git log -1 --pretty='%(trailers:key=Dispatch-Trailer,valueonly)')"
if [[ "$x" == "" ]]
then
# Some steps rely on the presence or otherwise of the Dispatch-Trailer.
# We know that we don't have a Dispatch-Trailer in this situation,
# hence we use the JSON value null in order to represent that state.
# This means that GitHub expressions can determine whether a Dispatch-Trailer
# is present or not by checking whether the fromJSON() result of the
# output from this step is the JSON value null or not.
x=null
fi
echo "value<<EOD" >> $GITHUB_OUTPUT
echo "$x" >> $GITHUB_OUTPUT
echo "EOD" >> $GITHUB_OUTPUT
- if: |-
((github.ref == 'refs/heads/main') && (! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"')))) && (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"'))
name: Check we don't have Dispatch-Trailer on a protected branch
run: |-
echo "github.event.head_commit.message contains Dispatch-Trailer but we are on a protected branch"
false
- name: Install Go
uses: actions/setup-go@v6
with:
cache: false
go-version: 1.25.x
- name: Set common go env vars
run: |-
case $(go env GOARCH) in
amd64) go env -w GOAMD64=v3 ;; # 2013 and later; makes `go test -race` 15% faster
arm64) go env -w GOARM64=v8.6 ;; # Apple M2 and later
esac
# Dump env for good measure
go env
- if: github.event_name != 'schedule' && matrix.runner != 'ns-windows-amd64'
uses: namespacelabs/nscloud-cache-action@v1
with:
cache: go
- if: |-
github.repository == 'cue-labs/oci' && (((github.ref == 'refs/heads/main') && (! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test'))
run: go env -w GOFLAGS=-count=1
- name: Early git and code sanity checks
run: go run cuelang.org/go/internal/ci/checks@v0.14.1
- working-directory: cmd/ocisrv
name: Generate cmd/ocisrv
run: go generate ./...
env:
GOWORK: ""
- working-directory: cmd/ocisrv
name: Test cmd/ocisrv
run: go test ./...
env:
GOWORK: ""
- working-directory: cmd/ocisrv
name: Check cmd/ocisrv
run: go vet ./...
env:
GOWORK: ""
- name: Staticcheck cmd/ocisrv
uses: dominikh/staticcheck-action@v1
with:
version: 2025.1.1
install-go: false
use-cache: false
working-directory: cmd/ocisrv
- working-directory: cmd/ocisrv
name: Generate cmd/ocisrv with GOWORK=off
run: go generate ./...
env:
GOWORK: "off"
- working-directory: cmd/ocisrv
name: Test cmd/ocisrv with GOWORK=off
run: go test ./...
env:
GOWORK: "off"
- working-directory: cmd/ocisrv
name: Check cmd/ocisrv with GOWORK=off
run: go vet ./...
env:
GOWORK: "off"
- name: Staticcheck cmd/ocisrv with GOWORK=off
uses: dominikh/staticcheck-action@v1
with:
version: 2025.1.1
install-go: false
use-cache: false
working-directory: cmd/ocisrv
- working-directory: ociregistry/internal/conformance
name: Generate ociregistry/internal/conformance
run: go generate ./...
env:
GOWORK: ""
- working-directory: ociregistry/internal/conformance
name: Test ociregistry/internal/conformance
run: go test ./...
env:
GOWORK: ""
- working-directory: ociregistry/internal/conformance
name: Check ociregistry/internal/conformance
run: go vet ./...
env:
GOWORK: ""
- name: Staticcheck ociregistry/internal/conformance
uses: dominikh/staticcheck-action@v1
with:
version: 2025.1.1
install-go: false
use-cache: false
working-directory: ociregistry/internal/conformance
- working-directory: ociregistry/internal/conformance
name: Generate ociregistry/internal/conformance with GOWORK=off
run: go generate ./...
env:
GOWORK: "off"
- working-directory: ociregistry/internal/conformance
name: Test ociregistry/internal/conformance with GOWORK=off
run: go test ./...
env:
GOWORK: "off"
- working-directory: ociregistry/internal/conformance
name: Check ociregistry/internal/conformance with GOWORK=off
run: go vet ./...
env:
GOWORK: "off"
- name: Staticcheck ociregistry/internal/conformance with GOWORK=off
uses: dominikh/staticcheck-action@v1
with:
version: 2025.1.1
install-go: false
use-cache: false
working-directory: ociregistry/internal/conformance
- working-directory: ociregistry
name: Generate ociregistry
run: go generate ./...
env:
GOWORK: ""
- working-directory: ociregistry
name: Test ociregistry
run: go test ./...
env:
GOWORK: ""
- working-directory: ociregistry
name: Check ociregistry
run: go vet ./...
env:
GOWORK: ""
- name: Staticcheck ociregistry
uses: dominikh/staticcheck-action@v1
with:
version: 2025.1.1
install-go: false
use-cache: false
working-directory: ociregistry
- working-directory: ociregistry
name: Generate ociregistry with GOWORK=off
run: go generate ./...
env:
GOWORK: "off"
- working-directory: ociregistry
name: Test ociregistry with GOWORK=off
run: go test ./...
env:
GOWORK: "off"
- working-directory: ociregistry
name: Check ociregistry with GOWORK=off
run: go vet ./...
env:
GOWORK: "off"
- name: Staticcheck ociregistry with GOWORK=off
uses: dominikh/staticcheck-action@v1
with:
version: 2025.1.1
install-go: false
use-cache: false
working-directory: ociregistry
- working-directory: internal/ci
name: Generate internal/ci
run: go generate ./...
env:
GOWORK: ""
- working-directory: internal/ci
name: Test internal/ci
run: go test ./...
env:
GOWORK: ""
- working-directory: internal/ci
name: Check internal/ci
run: go vet ./...
env:
GOWORK: ""
- name: Staticcheck internal/ci
uses: dominikh/staticcheck-action@v1
with:
version: 2025.1.1
install-go: false
use-cache: false
working-directory: internal/ci
- working-directory: internal/ci
name: Generate internal/ci with GOWORK=off
run: go generate ./...
env:
GOWORK: "off"
- working-directory: internal/ci
name: Test internal/ci with GOWORK=off
run: go test ./...
env:
GOWORK: "off"
- working-directory: internal/ci
name: Check internal/ci with GOWORK=off
run: go vet ./...
env:
GOWORK: "off"
- name: Staticcheck internal/ci with GOWORK=off
uses: dominikh/staticcheck-action@v1
with:
version: 2025.1.1
install-go: false
use-cache: false
working-directory: internal/ci
- run: go work sync
- if: always()
name: Check that git is clean at the end of the job
run: test -z "$(git status --porcelain)" || (git status; git diff; false)