Repository navigation
861 lines (840 loc) · 51.6 KB
/
Copy pathci.yml
File metadata and controls
861 lines (840 loc) · 51.6 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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
name: CI
on:
pull_request:
push:
branches: [main]
# Callable, so publishing a release runs these same checks against the release commit rather than
# trusting that they ran somewhere earlier.
workflow_call:
# Least privilege by default. Jobs that need more must declare it locally.
permissions:
contents: read
# The newest push on a pull request wins. Every commit on main keeps its own run, for the badge and
# for the release: publishing a release relies on main's CI having passed on the commit the release
# PR merged onto (scripts/release-ci-gate.ts). In one group, a push landing while another commit's
# run was in progress replaced the pending run of the commit before it, and that commit never got a
# result.
#
# `github.workflow` keeps the release's own call of these checks out of main's group. A called
# workflow sees its caller's context, so without it Publish release's checks shared
# `ci-refs/heads/main` with main's push runs: they queued behind whichever was in progress (the
# five-minute wait before the checks of v0.3.1) and cancelled the one that was pending.
#
# Pull requests from forks share one group, so contributors' CI runs one at a time and cannot fill
# the shared standard runners, and one contributor's push never cancels another's run. A fork run
# GitHub drops from the group's one pending slot is re-run later by Contributor CI
# (scripts/contributor-ci.ts), which also pauses fork runs while CopilotKit's are waiting.
concurrency:
group: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && format('ci-{0}-forks', github.workflow) || format('ci-{0}-{1}', github.workflow, github.ref == 'refs/heads/main' && github.sha || github.ref) }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
# Runners. Every job runs on the 16-core larger runners (org runner group openbot-larger, billed per
# minute) for main, releases and pull requests from this repository: the standard runners are shared
# across the organization, and a job used to wait longer for one than it took to run. Pull requests
# from forks stay on the free standard runners.
jobs:
# What this push has to run (scripts/ci-changes.ts). On a pull request, a job whose inputs are
# unchanged since a commit where it passed is skipped, and `verify` reads the skip as a pass: test
# files alone run just those tests, docs alone run only the tests that name them, and a release PR
# of only the release files runs the checks publishing re-runs on it. Main, the release's own call
# of these checks and a pull request labelled `full-ci` run everything.
changes:
name: changes
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
permissions:
contents: read
# To read which jobs passed on the commits this one sits on.
actions: read
outputs:
static: ${{ steps.decide.outputs.static }}
api: ${{ steps.decide.outputs.api }}
mobile: ${{ steps.decide.outputs.mobile }}
app_browser: ${{ steps.decide.outputs.app_browser }}
startup: ${{ steps.decide.outputs.startup }}
langgraph_ts: ${{ steps.decide.outputs.langgraph_ts }}
python_harness: ${{ steps.decide.outputs.python_harness }}
build: ${{ steps.decide.outputs.build }}
suite: ${{ steps.decide.outputs.suite }}
partial: ${{ steps.decide.outputs.partial }}
tests: ${{ steps.decide.outputs.tests }}
browser_tests: ${{ steps.decide.outputs.browser_tests }}
webkit_tests: ${{ steps.decide.outputs.webkit_tests }}
desktop_browser_tests: ${{ steps.decide.outputs.desktop_browser_tests }}
steps:
# A pull request's history, without file contents (a diff of names needs only the trees); any
# other event needs none.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Strings, since 0 is falsy and `&& 0 || 1` would always give 1.
fetch-depth: ${{ github.event_name == 'pull_request' && '0' || '1' }}
filter: ${{ github.event_name == 'pull_request' && 'blob:none' || '' }}
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
- id: decide
name: Decide what runs
env:
GH_TOKEN: ${{ github.token }}
run: bun scripts/ci-changes.ts ci
# Formatting, linting, typing and tests are independent checks, so each reports its own result.
static:
name: format, lint, types
needs: changes
if: needs.changes.outputs.static == 'true'
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Checkout leaves a usable credential in the runner otherwise, which every later step and
# every action it calls can read. Nothing here pushes.
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
- run: bun install --frozen-lockfile
- run: bun run format:check
- run: bun run lint
- run: bun run typecheck
- name: Desktop version tracks the release version
run: bun desktop/scripts/desktop-version.ts check
# What each recorded OpenBot Desktop launch hands Compose, read with this tree's
# docker-compose.yml by Compose itself: the file must take it, and must still hand the server
# everything the app of the published launcherApi gives it. See scripts/check-launcher-inputs.ts.
- name: Every recorded Desktop launch still starts this release's server
run: bun scripts/check-launcher-inputs.ts
# The API contract. api/openapi.yaml is the single source of truth every client is generated from,
# so four things are checked about it, each its own step so a red run names which:
#
# - it is what its sources bundle to: each area's operations live in api/openapi/<area>.yaml and the
# shared conventions in api/openapi/common.yaml, so builders editing different areas do not
# collide, and api/openapi.yaml is the bundle of them, checked in so every consumer reads one file;
# - it keeps OpenBot's API conventions (redocly.yaml, api/redocly/rules.mjs), which are Intelligence
# v2's, and takes no address Intelligence already serves (api/intelligence-reserved.yaml);
# - the clients generated from it are the ones committed (the app's app/src/lib/api/generated, the
# phone app's mobile/src/api/generated and the Recorder's extension/src/shared/generated):
# generated code is checked in, so each builds from what review saw, and this fails when somebody
# edited the spec without regenerating or edited the output by hand;
# - on a pull request, it breaks nothing a client of the base branch relies on. oasdiff compares the
# base branch's spec with this one and fails on any breaking change, warnings included: a field a
# client reads going away is a warning to oasdiff and a broken screen to a person. A change that
# takes nothing from a client (a rule the server already enforced, now written in the spec) is
# listed with its reason in api/accepted-breaking-changes.md, and only that change passes. Every
# deprecation names its sunset (`x-sunset`), at least 365 days after the change that deprecates
# it, and nothing is removed before its sunset;
# - it breaks nothing a client of a release it still serves relies on. The same comparison against
# the spec of every release of the last 12 months, and the last release's, on every run, so a
# string of changes each harmless against its own base cannot add up to a break for an app people
# already have, and a change let through as one no release serves is checked against what each
# release really serves;
# - the support window holds (scripts/support-window.ts): no oldest-app minimum cuts off an app
# released in the last 12 months, and every deprecation's sunset is at least 365 days after the
# release that first served it deprecated.
api:
name: API spec
needs: changes
if: needs.changes.outputs.api == 'true'
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
env:
# Pinned with its checksum, from https://github.com/oasdiff/oasdiff/releases. The spec never
# leaves the runner: the binary runs here, rather than the action, which uploads by default.
OASDIFF_VERSION: 1.38.0
OASDIFF_SHA256: 613037fd6a1d3362a1b742d6d86c338c0eb5ab3511f4942ce3948e78720ea2da
# The deprecation window (API versioning design, section 4.3): a deprecated operation,
# parameter or property keeps answering for at least this long, whatever its stability level.
DEPRECATION_DAYS: 365
REDOCLY_TELEMETRY: "off"
REDOCLY_SUPPRESS_UPDATE_NOTICE: "true"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
- run: bun install --frozen-lockfile
- name: The bundled spec matches its sources
run: |
set -euo pipefail
bun run api:bundle
changed="$(git status --porcelain -- api/openapi.yaml)"
if [ -n "$changed" ]; then
echo "$changed"
git --no-pager diff -- api/openapi.yaml | head -n 200
echo "::error::api/openapi.yaml is not what api/openapi/*.yaml bundle to. Edit the sources, run bun run api:bundle and commit the result."
exit 1
fi
- name: Lint the spec
run: bun run api:lint
- name: The generated clients match the spec
run: |
set -euo pipefail
bun run api:generate
generated=(app/src/lib/api/generated mobile/src/api/generated extension/src/shared/generated)
changed="$(git status --porcelain -- "${generated[@]}")"
if [ -n "$changed" ]; then
echo "$changed"
git --no-pager diff -- "${generated[@]}" | head -n 200
echo "::error::A generated client (${generated[*]}) is not what api/openapi.yaml generates. Run bun run api:generate and commit the result."
exit 1
fi
- name: Install oasdiff
run: |
set -euo pipefail
archive="$RUNNER_TEMP/oasdiff.tar.gz"
curl -fsSL -o "$archive" "https://github.com/oasdiff/oasdiff/releases/download/v${OASDIFF_VERSION}/oasdiff_${OASDIFF_VERSION}_linux_amd64.tar.gz"
echo "${OASDIFF_SHA256} $archive" | sha256sum -c -
tar -xzf "$archive" -C "$RUNNER_TEMP" oasdiff
- name: No breaking change against the base branch
if: github.event_name == 'pull_request'
env:
BASE_REF: ${{ github.base_ref }}
run: |
set -euo pipefail
git fetch --no-tags --depth=1 origin "$BASE_REF"
if ! git cat-file -e FETCH_HEAD:api/openapi.yaml 2>/dev/null; then
echo "::notice::$BASE_REF has no api/openapi.yaml yet, so this pull request cannot break it."
exit 0
fi
git show FETCH_HEAD:api/openapi.yaml > "$RUNNER_TEMP/base-openapi.yaml"
# A change listed in api/accepted-breaking-changes.md, with its reason, is let through; oasdiff
# matches each line by method, path and the change's own words, so nothing else is.
accepted=api/accepted-breaking-changes.md
# A deprecation made here must name its sunset, DEPRECATION_DAYS or more from today, and a
# sunset may not move earlier than the date clients were given. Removing anything deprecated
# before its sunset fails whatever the flags.
deprecation=(--deprecation-days-stable "$DEPRECATION_DAYS" --deprecation-days-beta "$DEPRECATION_DAYS")
# Twice: once readable in the log, once as annotations on the pull request's diff.
"$RUNNER_TEMP/oasdiff" breaking "$RUNNER_TEMP/base-openapi.yaml" api/openapi.yaml --flatten-allof "${deprecation[@]}" --err-ignore "$accepted" --warn-ignore "$accepted" || true
"$RUNNER_TEMP/oasdiff" breaking "$RUNNER_TEMP/base-openapi.yaml" api/openapi.yaml --flatten-allof "${deprecation[@]}" --fail-on WARN --format githubactions --err-ignore "$accepted" --warn-ignore "$accepted"
# Release names and dates are the published GitHub releases', the day each reached people.
- name: The published releases
env:
GH_TOKEN: ${{ github.token }}
run: gh release list --repo "$GITHUB_REPOSITORY" --limit 1000 --exclude-drafts --json tagName,publishedAt,isPrerelease > "$RUNNER_TEMP/releases.json"
# The spec of every release whose apps this tree's server still serves (scripts/support-window.ts
# held-releases): each release of the last 12 months at or below this tree's version, and the
# last release even once it has aged out, so a fix on a release branch is held to its own line.
# Each release's apps were built from its own spec and call this server, so the spec is held to
# each, not only to the last: a release in between need not have served everything an older one
# did. A release with no api/openapi.yaml predates this API and has no client of it.
#
# A line in api/accepted-breaking-changes.md that lets a change through because no release
# serves it yet ("no release serves it") is not applied here: if a release does serve it, that
# reason was wrong, and this fails. Every other line is, since its reason holds for any client.
#
# The deprecation window is not counted here: oasdiff counts it from today, and a deprecation
# made after the release is new against it on every run until the next one. The base-branch run
# counts it on the day the deprecation is made; scripts/support-window.ts counts it from the
# release that first served it.
- name: No breaking change against any release whose apps are served
run: |
set -euo pipefail
held="$(bun scripts/support-window.ts held-releases --releases "$RUNNER_TEMP/releases.json")"
if [ -z "$held" ]; then
echo "::notice::No release at or below this tree's version yet, so there is no released spec to hold to."
exit 0
fi
accepted="$RUNNER_TEMP/accepted-against-release.md"
grep -v -F 'no release serves it' api/accepted-breaking-changes.md > "$accepted" || true
failed=()
mapfile -t releases <<< "$held"
# One fetch for every release, each under a ref of its own, so a tag this checkout already
# holds is never in the way.
refspecs=()
for release in "${releases[@]}"; do refspecs+=("+refs/tags/$release:refs/held-releases/$release"); done
git fetch --no-tags --depth=1 origin "${refspecs[@]}"
for release in "${releases[@]}"; do
if ! git cat-file -e "refs/held-releases/$release:api/openapi.yaml" 2>/dev/null; then
echo "$release has no api/openapi.yaml, so no client of it uses this API."
continue
fi
echo "::group::Holding api/openapi.yaml to $release's"
git show "refs/held-releases/$release:api/openapi.yaml" > "$RUNNER_TEMP/release-openapi.yaml"
"$RUNNER_TEMP/oasdiff" breaking "$RUNNER_TEMP/release-openapi.yaml" api/openapi.yaml --flatten-allof --err-ignore "$accepted" --warn-ignore "$accepted" || true
echo "::endgroup::"
if ! "$RUNNER_TEMP/oasdiff" breaking "$RUNNER_TEMP/release-openapi.yaml" api/openapi.yaml --flatten-allof --fail-on WARN --format githubactions --err-ignore "$accepted" --warn-ignore "$accepted"; then
failed+=("$release")
fi
done
if [ "${#failed[@]}" -gt 0 ]; then
echo "::error::api/openapi.yaml breaks a client of ${failed[*]}, whose apps this server still serves."
exit 1
fi
- name: The 12-month support window holds
run: bun scripts/support-window.ts check --releases "$RUNNER_TEMP/releases.json"
# The live channels (api/asyncapi.yaml). The differences come from the AsyncAPI CLI, pinned in
# api/asyncapi-tools with its own lockfile so only this job installs it; what counts as breaking
# is decided in api/asyncapi-diff.ts, whose tests run here against real edits to the file.
- name: Install the AsyncAPI CLI
run: bun install --cwd api/asyncapi-tools --frozen-lockfile
- name: The live channels' breaking-change check works
run: bun test api/asyncapi-diff.test.ts
- name: No breaking change to the live channels against the base branch
if: github.event_name == 'pull_request'
env:
BASE_REF: ${{ github.base_ref }}
run: |
set -euo pipefail
git fetch --no-tags --depth=1 origin "$BASE_REF"
if ! git cat-file -e FETCH_HEAD:api/asyncapi.yaml 2>/dev/null; then
echo "::notice::$BASE_REF has no api/asyncapi.yaml yet, so this pull request cannot break it."
exit 0
fi
git show FETCH_HEAD:api/asyncapi.yaml > "$RUNNER_TEMP/base-asyncapi.yaml"
bun run api:live:diff "$RUNNER_TEMP/base-asyncapi.yaml" api/asyncapi.yaml
mobile:
name: native types
needs: changes
if: needs.changes.outputs.mobile == 'true'
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '22'
cache: npm
cache-dependency-path: mobile/package-lock.json
# The native app is an isolated npm package; adding it to Bun workspaces would change the
# existing desktop/server installation contract. CI installs its own reviewed lockfile.
- run: npm ci --prefix mobile --ignore-scripts
- run: npm run --prefix mobile typecheck
# The app's and the desktop window's tests that need a real Chromium, asked for by name because a
# machine running `bun test` is not required to have a browser. The browser is the one the root's
# playwright-core pins: a different Playwright's Chromium is a different build from the one
# playwright-core launches.
#
# Three jobs, side by side: this list in Chromium, the dictation test in WebKit, and the desktop
# setup window. One after another they took 11 to 20 minutes, the longest job of a run. The list's
# files run in parallel worker processes, one browser each (`bun test --parallel`, a worker per
# core by default).
#
# Each runs its tests in Playwright's own image for the playwright-core the root pins
# (PLAYWRIGHT_IMAGE), which has the browsers and every system package they need. Installing
# those packages on the runner came from the Ubuntu mirror, half a minute on a good day and three
# to nine on a bad one. Caching the browsers instead would not help: Playwright advises against
# it, as restoring them takes about as long as their download (4 seconds here), and a cache does
# not hold the system packages (https://playwright.dev/docs/ci#caching-browsers). The checkout,
# its installs and Bun are the runner's, handed to the image, so the tests run the same Bun as
# every other job. The tag and digest move with playwright-core (scripts/ci-changes.test.ts holds
# them together). `--ipc=host` gives Chromium the shared memory Playwright's Docker guidance asks
# for.
app-browser:
name: app (real browser)
needs: changes
if: needs.changes.outputs.app_browser == 'true'
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
env:
PLAYWRIGHT_IMAGE: mcr.microsoft.com/playwright:v1.62.1-noble@sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
- run: bun install --frozen-lockfile
# The app's real-browser tests: a running step's words
# under reduced motion, where onboarding's Back lands beside the Mac window's buttons, the name
# step's orb drawn whole under the step dashes, a conversation's rail of turns clear of the
# Bot's text, one frame around an interface drawn in a Card, the page under the update banner
# holding still as an update gets ready, Home's message box holding still while the
# microphone's notice shows, a reply staying where it was written once its turn is over,
# every skin's top-left corner clear of the Mac window's buttons, OpenDots' Bots badge on its
# icon's corner inside the rail, the version in the account row read whole, an organization's
# name in the account menu read whole or in a tooltip, a Bot's orb
# one color in the sidebar, on its page and at the top of its conversation, a conversation
# row's orbs whole in their avatar, compact and detailed, Record on
# screen with a Bot's page in a window of any width, the team screens and a Bot's
# Publish dialog holding their layout wide, narrow and on a phone, the composer's model picker
# naming every model whole on a phone, and the Admin screens
# where a rule or a grant names a team holding theirs wide and on a phone, an admin setting a
# team's models and a member reading them, wide and on a phone, a refused turn read as the
# app's notice with no rail beside a conversation that fits, an unticked
# tickbox's edge standing 3:1 from what it is drawn on in light and dark, a Needs you row read
# whole at a phone's width and a chat's with its answers on a line of their own, a Bot's maths
# drawn as formulas in KaTeX's font with a wide one scrolling in its own block, a delegated
# task shown once in its conversation, as its card, in every state, which only a
# browser's layout, cascade
# and paint resolve, and the app following the system's light or dark, which only a
# browser's `prefers-color-scheme` reports, with what OpenBot Desktop's window is told of
# it, a computer refused at a limit read on Activity as blocked and by which limit, and a
# sign-in through Composio held on OpenBot's own step for its countdown before it
# leaves, in this tab and in the new one a Bot's card opens, a picture over 8MB fetched
# only when it is opened, counted on the wire, and the AI connection changed in Settings, a
# key the provider refuses saying why and changing nothing, and on OpenBot Cloud a person
# held at Connect your AI until they connect their own, and Admin's Providers where an admin
# changes, disconnects and connects the organization's AI, told apart from their own, and
# People's Remove dialog and the SCIM row fitting wide and on a phone. The
# onboarding frame reads the generated app config, which `bun test` alone doesn't write (the
# test script's pretest does).
- run: bun run generate:app-config
- run: |
docker run --rm --ipc=host \
--volume "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" --workdir "$GITHUB_WORKSPACE" \
--volume "$(command -v bun):/usr/local/bin/bun:ro" \
--env OPENBOT_APP_BROWSER=1 \
"$PLAYWRIGHT_IMAGE" \
bun test --parallel app/tests/tool-line-reduced-motion.test.tsx app/tests/onboarding-window-buttons.test.tsx app/tests/onboarding-orb-room.test.tsx app/tests/transcript-rail-clearance.test.tsx app/tests/a2ui-frame.test.tsx app/tests/update-banner-layout.test.tsx app/tests/composer-dictation-notice-layout.test.tsx app/tests/conversation-intro-halo.test.tsx app/tests/transcript-room.test.tsx app/tests/skins-window-buttons.test.tsx app/tests/opendots-rail-badge.test.tsx app/tests/account-version-layout.test.tsx app/tests/organization-menu-names.test.tsx app/tests/bot-orb-one-color.test.tsx app/tests/compact-avatar-layout.test.tsx app/tests/theme-follows-system.test.tsx app/tests/desktop-window-theme.test.tsx app/tests/bot-screen-record-layout.test.tsx app/tests/teams-screens-layout.test.tsx app/tests/team-grants-screens-layout.test.tsx app/tests/team-models-screens-layout.test.tsx app/tests/conversation-refusal-layout.test.tsx app/tests/model-picker-phone-layout.test.tsx app/tests/needs-you-board-layout.test.tsx app/tests/checkbox-contrast.test.tsx app/tests/maths-rendering.test.tsx app/tests/task-report-chip.test.tsx app/tests/consent-handoff.test.tsx app/tests/large-picture-tile.test.tsx app/tests/audit-computer-limit-layout.test.tsx app/tests/ai-connection-dialog.test.tsx app/tests/connect-your-ai.test.tsx app/tests/admin-providers-connection.test.tsx app/tests/admin-people-remove-layout.test.tsx
# Dictation in the Desktop window on a Mac whose recognizer has no English (United Kingdom) on
# the device, in Chromium and in WebKit, the engine the Mac window draws with: it listens in the
# next language the recognizer has, or says which language to add and where. The page's
# language and its names for languages are the engine's own. And the sidebar's edge, dragged in a
# window zoomed in, narrowing the sidebar, which never takes more than two-fifths of the window.
# And the terms on OpenBot Cloud: the gate holding a person at them from anywhere until they tick
# the box and agree, asking again when they change, and never shown where there are none, in the
# engine the Mac window draws with too. And Settings' Move to OpenBot Cloud row and its dialog,
# in both engines, and after a move the bar that says which organization holds the moved Bots and
# the account a connected app is signed in as. And a message sent from home that gets no answer, said in OpenBot's words and
# never the engine's own ("Load failed" in WebKit). And Routines lit on the strip on its own page,
# chosen again after the Bots panel was opened over it. And Organization settings' Members list,
# where only an owner is offered Remove on another owner's row. And an admin's settings changes
# drawn as their cards in a conversation, waiting and answered, beside the Admin screens they
# change, and the cards for a Bot changing a person's settings or Bots, each beside the screen it
# changes, and the cards for a Bot reading them, every one opening its screen with the same link,
# and each change waiting on the person titled in plain words. And the chat card's one Connect for an app nobody has turned on, which goes straight
# to the key form or to the sign-in in a tab claimed on the click, and an admin's one press on
# an app that has listed nothing yet, which signs them in and then gives it to the Bot. And a part of the app whose
# file didn't load (a release replaced the page's build, or the connection dropped) fetched again
# by loading the page once, else OpenBot's own error screen with Reload, the details and the log
# folder. And a Bot's answer reading as stored after the person switches to another conversation
# while it is written and comes back, in both engines. And the lists of people with a long name in
# them, whose words stay clear of the row's controls. And every list of people paging and
# searching on the server (Members, Invitations, Teams, a team's people), and each place a person
# is picked offering only the organization's own members. In the image, as above: WebKit's
# system packages are about 94 MB, which took nine minutes from the mirror on a slow day.
app-browser-webkit:
name: app (real browser, WebKit)
needs: changes
if: needs.changes.outputs.app_browser == 'true'
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
env:
PLAYWRIGHT_IMAGE: mcr.microsoft.com/playwright:v1.62.1-noble@sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
- run: bun install --frozen-lockfile
- run: bun run generate:app-config
- run: |
docker run --rm --ipc=host \
--volume "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" --workdir "$GITHUB_WORKSPACE" \
--volume "$(command -v bun):/usr/local/bin/bun:ro" \
--env OPENBOT_APP_BROWSER=1 --env OPENBOT_APP_ENGINES=chromium,webkit \
"$PLAYWRIGHT_IMAGE" \
bun test app/tests/chunk-recovery.test.tsx app/tests/composer-dictation-language.test.tsx app/tests/sidebar-zoom-drag.test.tsx app/tests/service-terms.test.tsx app/tests/move-to-cloud-settings.test.tsx app/tests/moved-elsewhere.test.tsx app/tests/home-no-answer.test.tsx app/tests/section-strip-routines.test.tsx app/tests/organization-members-remove.test.tsx app/tests/settings-tool-cards-admin-layout.test.tsx app/tests/settings-tool-cards-personal.test.tsx app/tests/settings-tool-cards-core.test.tsx app/tests/one-press-connect-layout.test.tsx app/tests/admin-notion-one-press-layout.test.tsx app/tests/team-connections-directory-layout.test.tsx app/tests/conversation-switch.test.tsx app/tests/member-rows-long-names.test.tsx app/tests/people-lists.test.tsx
# Connect your AI's sign-in code, copied with one press and read back from WebKit's clipboard.
# Only that test: the rest of the file runs in Chromium in the job above.
- run: |
docker run --rm --ipc=host \
--volume "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" --workdir "$GITHUB_WORKSPACE" \
--volume "$(command -v bun):/usr/local/bin/bun:ro" \
--env OPENBOT_APP_BROWSER=1 --env OPENBOT_APP_ENGINES=webkit \
"$PLAYWRIGHT_IMAGE" \
bun test app/tests/connect-your-ai.test.tsx -t "copies with one press"
# The Reconnect list after a move to OpenBot Cloud, in both engines: one press of Reconnect is
# the whole connect (the sign-in, or the key form), and back to the list once it's connected.
- run: |
docker run --rm --ipc=host \
--volume "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" --workdir "$GITHUB_WORKSPACE" \
--volume "$(command -v bun):/usr/local/bin/bun:ro" \
--env OPENBOT_APP_BROWSER=1 --env OPENBOT_APP_ENGINES=chromium,webkit \
"$PLAYWRIGHT_IMAGE" \
bun test app/tests/moved-apps-reconnect.test.tsx
# The desktop setup window's, for the same reason as the list above: the AI step's form holding
# still while the install behind it comes and goes. It bundles the window from the desktop's own
# dependencies. One file, so it is its own job rather than one of the list's workers. In the
# image, as above.
app-browser-desktop:
name: app (real browser, desktop setup window)
needs: changes
if: needs.changes.outputs.app_browser == 'true'
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
env:
PLAYWRIGHT_IMAGE: mcr.microsoft.com/playwright:v1.62.1-noble@sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
- run: bun install --frozen-lockfile
- run: bun install --frozen-lockfile
working-directory: desktop
- run: |
docker run --rm --ipc=host \
--volume "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" --workdir "$GITHUB_WORKSPACE/desktop" \
--volume "$(command -v bun):/usr/local/bin/bun:ro" \
--env OPENBOT_APP_BROWSER=1 \
"$PLAYWRIGHT_IMAGE" \
bun test src/setupLayout.browser.test.ts
# The suite in shards, one runner each, so the run takes as long as its slowest shard rather than
# as long as every file one after another. `bun test --shard` does the split, cut by the per-file
# durations in scripts/test-timings.json so the shards take about as long as each other (dealt
# round-robin, the few files that take a minute each pile up on one runner). Every shard has its
# own installs, so the shards share no state. The `tests` job below is the result people read.
#
# The id stays `test` for the upstream upgrade, which runs this job's `run` steps as CI's own
# checks (scripts/integrate-upstream.ts); the shard reaches those steps through
# .github/actions/test-shard, which says why.
test:
name: tests (shard ${{ matrix.shard }} of ${{ strategy.job-total }})
needs: changes
if: needs.changes.outputs.suite == 'true'
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
strategy:
# Every shard runs to the end, so one red run names every failing test, not just the first
# shard's.
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
- uses: $/.github/actions/test-shard
with:
shard: ${{ matrix.shard }}/${{ strategy.job-total }}
- run: bun install --frozen-lockfile
# The Bots are not root workspaces and each keeps its own lockfile. The Mastra Bot's: root
# test discovery imports its receiver tests, which load Mastra from that Bot's own dependency
# tree.
- run: bun install --frozen-lockfile
working-directory: agent-mastra
# Same for the desktop app: root test discovery imports its React tests, whose JSX runtime is
# pinned by the desktop lockfile rather than the root one.
- run: bun install --frozen-lockfile
working-directory: desktop
# This shard's tests, failing on a failed test or on a count it cannot read. The floor under the
# count is the suite's, so the `tests` job checks it on the sum of the shards.
- run: bun run test:ci
# The shard's count, and how long each of its files took.
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: test-shard-${{ matrix.shard }}
path: ${{ env.TEST_COUNT_DIR }}
if-no-files-found: error
retention-days: 1
# One result for the suite, under the name the unsharded job had. A passing job must include the
# expected test floor: import-time failures can otherwise skip files before their tests are
# registered, and a shard cannot see that, because it does not know how big it is meant to be. So
# this fails when any shard did not succeed, when any shard's count is missing, and when the counts
# add up to less than the floor (scripts/test-floor.ts).
test-total:
name: tests
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
# Also when a shard failed, so this reports the failure rather than being skipped, which a
# required check would read as a pass. Not when the suite was not needed: then no shard ran.
if: always() && needs.changes.outputs.suite == 'true'
needs: [changes, test]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: test-shard-*
path: ${{ runner.temp }}/test-counts
merge-multiple: true
- name: The shards passed and add up to the floor
env:
SHARDS_RESULT: ${{ needs.test.result }}
run: bun scripts/test-ci-aggregate.ts "$RUNNER_TEMP/test-counts" "$RUNNER_TEMP/test-timings.json"
# This run's per-file durations, to download over scripts/test-timings.json when the shards
# drift out of balance.
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: test-timings
path: ${{ runner.temp }}/test-timings.json
if-no-files-found: ignore
retention-days: 14
# The test files `changes` picked when the suite itself was not needed: the ones changed since the
# suite last passed and every test that names a changed file, or for a release PR the tests that
# read the release files. A browser test runs in a real browser, as `app (real browser)` runs it.
# Not a shard, so passing here never stands in for the suite: the next push is still compared with
# the commit where every shard last passed.
changed-tests:
name: tests (changed files)
needs: changes
if: needs.changes.outputs.partial == 'true'
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
# The same installs as a shard, since a picked file can be anywhere the suite looks.
- run: bun install --frozen-lockfile
- run: bun install --frozen-lockfile
working-directory: agent-mastra
- run: bun install --frozen-lockfile
working-directory: desktop
- name: Install Chromium
if: needs.changes.outputs.browser_tests != '[]' || needs.changes.outputs.desktop_browser_tests != '[]'
run: bunx playwright-core install --with-deps --no-shell chromium
- name: Install WebKit
if: needs.changes.outputs.webkit_tests != '[]'
run: bunx playwright-core install --with-deps webkit
- name: Run the changed tests
env:
TESTS: ${{ needs.changes.outputs.tests }}
BROWSER_TESTS: ${{ needs.changes.outputs.browser_tests }}
WEBKIT_TESTS: ${{ needs.changes.outputs.webkit_tests }}
DESKTOP_BROWSER_TESTS: ${{ needs.changes.outputs.desktop_browser_tests }}
run: bun scripts/ci-run-tests.ts
startup:
name: startup (${{ matrix.os }})
needs: changes
if: needs.changes.outputs.startup == 'true'
runs-on: ${{ matrix.os == 'windows-latest' && (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'windows-latest' || 'openbot-windows-16core') || matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# No cached Bun on Windows. The cache keeps bun.exe at a path relative to the workspace, so
# one saved by a job whose workspace was on C: restores to D:\Users\... on a runner whose
# workspace is on D:, and setup-bun then fails on C:\Users\runneradmin\.bun\bin\bun.exe
# ("Unable to locate executable file") instead of downloading Bun.
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
no-cache: ${{ runner.os == 'Windows' }}
- run: bun install --frozen-lockfile
- run: bun test app/tests/build-cache.test.ts
# The TypeScript LangGraph engine, the default Bot engine: its type check and its own tests, on the
# Node it ships on, from its own lockfile, as each Python harness below runs its own.
langgraph-ts:
name: typescript langgraph engine
needs: changes
if: needs.changes.outputs.langgraph_ts == 'true'
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "22"
- run: npm ci
working-directory: agent-langgraph-ts
- run: npm run typecheck
working-directory: agent-langgraph-ts
- run: npm test
working-directory: agent-langgraph-ts
# One job per harness, side by side: each is a fresh venv, its own requirements and its own tests,
# so nothing is shared between them and run in a row they took ten minutes. The list is
# PYTHON_HARNESSES in scripts/ci-changes.ts, which waits on each of these jobs by name.
#
# pip, not uv: the images install with pip from the same unpinned files, so the tests resolve what
# ships. The pip cache holds downloads and wheels only, keyed per harness on its requirement
# files; the resolve still runs every time, so a new release upstream is still picked up.
python-harness:
name: python harness (${{ matrix.harness }})
needs: changes
if: needs.changes.outputs.python_harness == 'true'
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
strategy:
fail-fast: false
matrix:
harness:
- agent-crewai
- agent-claude-sdk
- agent-langgraph-agui
- agent-llamaindex
- agent-agno
- agent-strands
- agent-pydantic-ai
- agent-adk
- agent-antigravity
- agent-langroid
- agent-ag2
- agent-microsoft
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"
cache: pip
cache-dependency-path: ${{ matrix.harness }}/requirements*.txt
- name: Regressions
env:
HARNESS: ${{ matrix.harness }}
run: |
set -euo pipefail
python -m venv .venv
. .venv/bin/activate
python -m pip install --requirement "$HARNESS/requirements.txt" --requirement "$HARNESS/requirements-test.txt"
python -m pytest "$HARNESS/tests" -q
# The Compose file the harnesses are picked through, checked once rather than per harness.
python-harness-compose:
name: compose config
needs: changes
if: needs.changes.outputs.python_harness == 'true'
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
- run: bun install --frozen-lockfile
- run: bun test tests/compose.test.ts
- run: docker compose --env-file /dev/null --profile harness config --format json >/dev/null
env:
PICKED_HARNESS_IMAGE: openbot-agent-langgraph-agui:test
# Docker Desktop shipped Compose v2.24.5 in early 2024, and that version refuses the whole
# project when any service's image is blank, profile or not. The desktop app runs
# `compose config` before it starts, so this is the oldest Compose it has to get past.
- name: Compose v2.24.5 reads the file with no harness picked
run: |
set -euo pipefail
case "$(uname -m)" in
x86_64) arch=x86_64; sum=94355be1d1d395040bbda1490f98d5c7627c30798a7955e1f2a78fda33a4b3e1 ;;
aarch64) arch=aarch64; sum=535e90ff9a7f24384f8a38f9f9ad49125485af7ae5ffda7226d091e5b8126948 ;;
*) echo "no pinned Compose v2.24.5 for $(uname -m)" >&2; exit 1 ;;
esac
compose="$RUNNER_TEMP/docker-compose-2.24.5"
curl -fsSL --retry 3 -o "$compose" "https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-linux-$arch"
echo "$sum $compose" | sha256sum -c -
chmod +x "$compose"
"$compose" version
unset PICKED_HARNESS_IMAGE
"$compose" -f docker-compose.yml -f desktop/src-tauri/telemetry.compose.yml --env-file /dev/null config --format json >/dev/null
PICKED_HARNESS_IMAGE=openbot-agent-langgraph-agui:test "$compose" --env-file /dev/null --profile harness config --format json >/dev/null
build:
name: build
needs: changes
if: needs.changes.outputs.build == 'true'
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
- run: bun install --frozen-lockfile
- run: bun run build
# The images the release publishes from this tree: the Bots and the harnesses. Nothing else here
# builds them: they are built by `docker compose up --build` or pulled by a harness pick, so a
# broken Dockerfile used to surface during a release.
#
# Built, not pushed, and one architecture: this answers whether the Dockerfile resolves. Whether
# it resolves on arm64 too is answered at release time, on an arm64 runner.
#
# Minutes rather than seconds, so on a pull request these run only when an admin adds the
# `full-ci` label, the point at which the PR is actually a merge candidate. On main and through
# the release's workflow_call they always run. `verify` treats a skipped job as passing.
#
# A Dockerfile the release does not publish is one a machine would build from source, so the
# list and the tree have to agree. Checked here rather than trusted, because the failure is
# silent: the release succeeds and a laptop somewhere builds the image. The management agent
# is not a harness: its image is published with OpenBot's server images. The list it checks is
# the one the builds below fan out over.
component-list:
name: component list
runs-on: ubuntu-latest
if: >-
github.event_name != 'pull_request' ||
contains(github.event.pull_request.labels.*.name, 'full-ci')
outputs:
components: ${{ steps.list.outputs.components }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Every buildable service is published
run: |
set -euo pipefail
found="$(find . -mindepth 2 -maxdepth 2 -name Dockerfile -not -path './node_modules/*' \
-not -path './management-agent/*' \
| sed -e 's|^\./||' -e 's|/Dockerfile$||' | sort)"
published="$(jq -r '.[]' .github/published-images.json | sort)"
if [ "$found" != "$published" ]; then
echo "::error::.github/published-images.json does not match the Dockerfiles in the tree."
diff <(echo "$published") <(echo "$found") || true
exit 1
fi
- id: list
run: echo "components=$(jq -c . .github/published-images.json)" >> "$GITHUB_OUTPUT"
# One runner per image, so the check takes as long as the slowest image rather than all of them
# one after another. Each reads the build cache images.yml writes for the same image and
# architecture (`<image>-amd64`), and a run on main writes it back, so main keeps the release's
# cache warm and the release's builds reuse what main already built. None of the Dockerfiles
# declares the OPENBOT_BUILD_* args images.yml passes, so leaving them out here changes no layer.
# A pull request reads that cache but never writes it: a labelled PR's cache could only be read
# by that PR, and would push main's out of the repository's cache quota.
component-dockerfiles:
name: component dockerfile (${{ matrix.image }})
needs: component-list
runs-on: ubuntu-latest
strategy:
# Every image is built to the end, so one red run names every Dockerfile that broke.
fail-fast: false
matrix:
image: ${{ fromJSON(needs.component-list.outputs.components) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
# build-push-action rather than `docker buildx build` in a `run:` step: the gha cache needs the
# runner's ACTIONS_* values, which this action hands to buildx and a plain step does not have.
# It is the action images.yml publishes with, pinned the same, so nothing new is trusted here.
- uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
file: ${{ matrix.image }}/Dockerfile
platforms: linux/amd64
push: false
outputs: type=cacheonly
cache-from: type=gha,scope=${{ matrix.image }}-amd64
cache-to: ${{ github.event_name != 'pull_request' && format('type=gha,mode=max,ignore-error=true,scope={0}-amd64', matrix.image) || '' }}
provenance: false
# One check for branch protection to require. A new job above is covered by this without anybody
# remembering to add it to a list, and a job that was skipped for the wrong reason is not a pass.
# A job `changes` found nothing to do for is skipped and passes; `changes` itself must succeed, so
# a decision that failed skips nothing.
verify:
name: verify
runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }}
if: always()
needs: [changes, static, api, mobile, app-browser, app-browser-webkit, app-browser-desktop, test, test-total, changed-tests, startup, langgraph-ts, python-harness, python-harness-compose, build, component-list, component-dockerfiles]
steps:
- name: Require every check
env:
RESULTS: ${{ join(needs.*.result, ' ') }}
CHANGES: ${{ needs.changes.result }}
run: |
set -euo pipefail
echo "$RESULTS"
if [ "$CHANGES" != success ]; then
echo "::error::Deciding what runs reported $CHANGES, so the skipped checks are not passes."
exit 1
fi
for result in $RESULTS; do
case "$result" in
success|skipped) ;;
*) echo "::error::A required check reported $result"; exit 1 ;;
esac
done