Repository navigation
Computer: say a shared private Bot's computer is private, not starting #10520
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| # The merge queue: main's merge queue builds each pull request on top of main and the pull | |
| # requests ahead of it (a gh-readonly-queue/main/* ref), and merges it only once `verify` passes | |
| # there. Like any event but a pull request, a merge group runs everything (scripts/ci-changes.ts), | |
| # since its tree is one no run has checked yet. The commit main then moves to is the one it tested, | |
| # so main's run of that push does not run the checks a second time (see `changes`). | |
| merge_group: | |
| # 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. | |
| # | |
| # Only a pull request's own push cancels. The release's call of these checks runs with the release | |
| # push's context, a push to main or to a release branch, and is never cancelled by the next one | |
| # (scripts/workflow-concurrency.test.ts). | |
| 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.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }} | |
| # Runners. The checks run 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. The few-second jobs every run waits on, `changes` | |
| # before the checks and `tests` and `verify` after them, run on a standard runner for everyone, so | |
| # a run never queues behind the larger runners' backlog just to start or to report | |
| # (scripts/ci-runners.test.ts). | |
| 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's run of a commit the | |
| # merge queue merged skips the checks the queue's run already passed on that same commit, and runs | |
| # only `component dockerfile` and any job whose cache key the push changed, which write the caches | |
| # pull requests read. A merge group is decided like a pull request, from main's history and the | |
| # queued pull request's: a job runs unless nothing it reads changed since it passed on one of them. | |
| # A push to main the queue did not pass, the release's own call of these checks and a pull request | |
| # labelled `full-ci` (in its own runs and in the queue) run everything. CHANGELOG.md is never a | |
| # reason to run anything: the release writes it, so a pull request leaves its change out of every | |
| # decision, and a merge group that changes nothing else runs nothing. | |
| changes: | |
| name: changes | |
| # A standard runner: it reads the API for a few seconds, and every other job waits on it, | |
| # so it must not queue behind the 16-core pool's backlog. | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 # usually under half a minute | |
| permissions: | |
| contents: read | |
| # To read which jobs passed on the commits this one sits on, and to cancel this run at its | |
| # first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| outputs: | |
| static: ${{ steps.decide.outputs.static }} | |
| api: ${{ steps.decide.outputs.api }} | |
| mobile: ${{ steps.decide.outputs.mobile }} | |
| app_browser: ${{ steps.decide.outputs.app_browser }} | |
| app_browser_webkit: ${{ steps.decide.outputs.app_browser_webkit }} | |
| startup: ${{ steps.decide.outputs.startup }} | |
| langgraph_ts: ${{ steps.decide.outputs.langgraph_ts }} | |
| python_harness: ${{ steps.decide.outputs.python_harness }} | |
| build: ${{ steps.decide.outputs.build }} | |
| components: ${{ steps.decide.outputs.components }} | |
| 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 }} | |
| queue_run: ${{ steps.decide.outputs.queue_run }} | |
| ignored_only: ${{ steps.decide.outputs.ignored_only }} | |
| steps: | |
| # A pull request's or a merge group'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' || github.event_name == 'merge_group') && '0' || '1' }} | |
| filter: ${{ (github.event_name == 'pull_request' || github.event_name == 'merge_group') && '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 }} | |
| # The caller's name in the release's call of these checks, so that call is told from | |
| # main's own run of the same push. | |
| WORKFLOW_NAME: ${{ github.workflow }} | |
| run: bun scripts/ci-changes.ts ci | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # 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' | |
| # A standard runner: about a minute on 16 cores and the same on a fork's standard runner | |
| # (scripts/ci-runners.test.ts), so 16 cores buy nothing here. | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 # usually about a minute | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| 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 | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # 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, | |
| # OpenBot Mobile'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' | |
| # A standard runner: about 1.7 minutes on either, so 16 cores buy nothing (scripts/ci-runners.test.ts). | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 # usually about a minute | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| 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" | |
| # Retried on any error: github.com's release downloads answered some runs HTTP 618, which | |
| # curl's plain --retry does not count as transient, and failed the job on 30 November. | |
| curl -fsSL --retry 5 --retry-all-errors -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 | |
| # A merge group is held to the main it is built on, so pull requests merged together are | |
| # checked against main as one change. | |
| - name: No breaking change against the base branch | |
| if: github.event_name == 'pull_request' || github.event_name == 'merge_group' | |
| env: | |
| BASE_REF: ${{ github.event_name == 'merge_group' && github.event.merge_group.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' || github.event_name == 'merge_group' | |
| env: | |
| BASE_REF: ${{ github.event_name == 'merge_group' && github.event.merge_group.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 | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| mobile: | |
| name: native types | |
| needs: changes | |
| if: needs.changes.outputs.mobile == 'true' | |
| # A standard runner: under a minute on either (scripts/ci-runners.test.ts). | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 # usually under a minute | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0 | |
| with: | |
| node-version: '22' | |
| cache: npm | |
| cache-dependency-path: mobile/package-lock.json | |
| # OpenBot Mobile 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 phone's tests that load what only its own install has (React, TanStack Query, Expo's | |
| # modules); the root's `bun test` runs the rest without them (mobile/tests/with-packages/run.ts). | |
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.4.3 | |
| - run: npm run --prefix mobile test:packages | |
| # Expo's own checks of the project: its config, its lockfile, and one version of each native | |
| # module. The comparison against Expo's live list of versions is left out: a patch Expo | |
| # publishes would fail a pull request that changed nothing. `npm run doctor` on a laptop | |
| # still makes it. The checks that remain ask Expo's API for a schema, so an outage there | |
| # warns and does not fail. | |
| - run: npm run --prefix mobile doctor | |
| env: | |
| EXPO_DOCTOR_SKIP_DEPENDENCY_VERSION_CHECK: "1" | |
| EXPO_DOCTOR_WARN_ON_NETWORK_ERRORS: "1" | |
| # The JavaScript both phones load, built the way a release builds it: an import that does not | |
| # resolve fails here and not on a phone. | |
| - run: npm run --prefix mobile bundle | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # 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' }} | |
| timeout-minutes: 20 # usually about 4 minutes | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| 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, onboarding's reels playing each scene on their | |
| # videos' clock, standing still under reduced motion and dark in dark, 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, and an unsent reply and | |
| # its files staying with their conversation across a switch and a reload, and a picture a Bot | |
| # made drawn as the sent file's card is, in every state, opening full size. And a component | |
| # published in the Playground drawn in a conversation for a Bot holding it, and refused for | |
| # one held back from it, with its grants arriving after the page opened. And the Recorder, | |
| # built as it ships and loaded in Chromium: a tab it followed lets its service worker stay | |
| # stopped once nothing records, and its recording mark asks what lies under it only when the | |
| # page changes. 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: | | |
| # One file per line, sorted: pull requests that each add a file then merge cleanly. | |
| files=( | |
| app/tests/a2ui-frame.test.tsx | |
| app/tests/account-row-layout.test.tsx | |
| app/tests/admin-people-remove-layout.test.tsx | |
| app/tests/admin-providers-connection.test.tsx | |
| app/tests/ai-connection-dialog.test.tsx | |
| app/tests/audit-approval-trace-layout.test.tsx | |
| app/tests/audit-bot-work-layout.test.tsx | |
| app/tests/audit-change-outcome-layout.test.tsx | |
| app/tests/audit-computer-limit-layout.test.tsx | |
| app/tests/bot-orb-one-color.test.tsx | |
| app/tests/bot-screen-record-layout.test.tsx | |
| app/tests/checkbox-contrast.test.tsx | |
| app/tests/compact-avatar-layout.test.tsx | |
| app/tests/composer-dictation-notice-layout.test.tsx | |
| app/tests/composer-keeps-draft-browser.test.tsx | |
| app/tests/connect-your-ai.test.tsx | |
| app/tests/consent-handoff.test.tsx | |
| app/tests/conversation-intro-halo.test.tsx | |
| app/tests/conversation-refusal-layout.test.tsx | |
| app/tests/desktop-window-theme.test.tsx | |
| app/tests/generated-image-browser.test.tsx | |
| app/tests/large-picture-tile.test.tsx | |
| app/tests/maths-rendering.test.tsx | |
| app/tests/memory-card-layout.test.tsx | |
| app/tests/model-picker-phone-layout.test.tsx | |
| app/tests/needs-you-board-layout.test.tsx | |
| app/tests/onboarding-orb-room.test.tsx | |
| app/tests/onboarding-reels.test.tsx | |
| app/tests/onboarding-window-buttons.test.tsx | |
| app/tests/opendots-rail-badge.test.tsx | |
| app/tests/organization-menu-names.test.tsx | |
| app/tests/playground-component-in-chat.test.tsx | |
| app/tests/skins-window-buttons.test.tsx | |
| app/tests/task-report-chip.test.tsx | |
| app/tests/team-grants-screens-layout.test.tsx | |
| app/tests/team-models-screens-layout.test.tsx | |
| app/tests/teams-screens-layout.test.tsx | |
| app/tests/theme-follows-system.test.tsx | |
| app/tests/tool-line-reduced-motion.test.tsx | |
| app/tests/transcript-rail-clearance.test.tsx | |
| app/tests/transcript-room.test.tsx | |
| app/tests/update-banner-layout.test.tsx | |
| extension/tests/idle-worker.browser.test.ts | |
| extension/tests/recording-mark.browser.test.ts | |
| ) | |
| 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 "${files[@]}" | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # 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. And a hold on an organization that | |
| # lasts several Retry-Afters: the open page fills in by itself once OpenBot answers, and the | |
| # signed-in gate says the hold, never terms to agree to. And a Bot's screen on a display of two | |
| # device pixels to one, told to the computer at that size and drawn as sharp, with a click on it | |
| # still landing where it is seen. And a conversation with a Bot started from under it in the | |
| # Bots panel. And a Bot's table of links, downloaded as Markdown and as CSV with its links, and | |
| # looking exactly as Streamdown's own table. And a conversation's row in the Conversations and | |
| # Bots panels saying Working for as long as its Bot works, through a read of every query and | |
| # while a task it handed out works on. And Return in the message box starting a new line on a | |
| # phone's touch keyboard while a computer's Enter still sends, never on the Enter that confirms | |
| # a composed character. And a Bot's instructions at 5000 characters, held whole by its Setup | |
| # page and the New Bot sheet, and a 5001st refused in view. And push notifications in this | |
| # browser, turned on and off in Settings and saved through the API, a push shown by the service | |
| # worker and a click on it opening its conversation, and on an iPhone in Safari the Home Screen | |
| # step said instead of a switch. And Browse apps on a directory the size of the live one, its | |
| # first page drawn after one request and the next read as the end comes into view, searched a | |
| # page at a time, on a phone and wide. And a first message, from home and from a new | |
| # conversation with or without a Bot in To:, showing "Thinking" within 200 ms of Send and every | |
| # frame after until the Bot's first words. And a conversation with two Bots keeping the side | |
| # margin a conversation with one keeps, on a phone and wide. And a model picked in a new | |
| # conversation with nobody in To:, saved with the conversation of the Bot OpenBot picks, or said | |
| # to be unused by a Bot that picks its own. And a page opened signed out, such as API keys from | |
| # OpenBot Desktop's Open in browser, landed on again after signing in, through OpenBot Cloud's | |
| # hosted sign-in and through Better Auth, with a return path off the app refused. And a test in these files that the browser's renderer | |
| # crashed in running once more, and no other failure (renderer-crash.ts): WebKit on Linux crashes | |
| # its own renderer under this job's load. | |
| # And Sign in with Apple's button white with its logo and title black, in both themes and every | |
| # state, lined up with the sign-in buttons beside it, and People naming Apple. | |
| # And a select of names as long as a Bot's may be, in words, unbroken, Japanese and Cyrillic, in | |
| # each way the app draws one: closed inside its form with an ellipsis, open with every name whole. | |
| # And a command the person stopped reading as stopped, not running, at once and when the | |
| # conversation is opened again. | |
| # And a long conversation, with pictures arriving after its words, opening at its newest message: | |
| # loaded, opened from the sidebar, gone back to, and when its newest turn arrives after it is | |
| # drawn (a read a moment behind, a turn asked from a phone meanwhile). | |
| # And a save whose refresh is refused for too many requests (429) saying it is saved at once, and | |
| # a conversation whose history read is refused keeping what it shows, then loading, never said | |
| # to be unavailable. | |
| # And an artifact a sign-in may not see said as the sign-in's on its card and on the Artifacts | |
| # page, never as deleted, which only an artifact not found is. | |
| # And that what is already drawn does not move: Home's heading and box when the page finishes | |
| # loading, and the app's frame drawn while the sign-in checks run when the page behind it | |
| # arrives. | |
| # And a conversation with one very long turn (thirty meetings of a megabyte read in parts, then | |
| # thirty DMs: 13,000 events, 40 MB) opened in a new tab and reloaded, its answer on screen soon, | |
| # its renderer's memory bounded and the page holding its folded lines rather than the whole | |
| # turn; and an ordinary conversation's folded line, steps and results opening as before. | |
| # And an interrupted turn's notice, dismissed with its button or Escape, staying dismissed | |
| # through a reload until the next turn, wide and on a phone. | |
| # And a Bot waiting on one question: the message box says "Type your answer…" and a screen reader | |
| # calls it that, the answer sent from it closes the question, and the box goes back to "Ask | |
| # anything", wide and on a phone, light and dark. | |
| # And a name as long as a Bot's or a team's may be, in words, unbroken, Japanese and Cyrillic: a | |
| # Bot's page's title, the Back link at the top of every page under it, the Bot each rule picks on | |
| # Describe it in words, and a team's page and its parent team, inside the window on a phone. | |
| # And Audit's "Try a change" handing its action to What would happen by an all-digit handle: the | |
| # link, the page, a reload, and the bare address an older tab kept. | |
| # And Admin's page of an app added by its address and reached as the person asking: its "How this | |
| # is reached" row, through the app OpenBot is part of (named by its token endpoint's host) and | |
| # through Microsoft Entra, with no token to paste. | |
| # And Report a bug, Your bug reports and Admin's Bug reports, wide and on a phone, light and dark, | |
| # held against Add credential and the Vault: a file taken, one refused, the report saved. | |
| # And the account menu with OpenBot on this computer saying so in place of the stand-in email, | |
| # and its Connect to an OpenBot opening Settings → Computer at Connection. In the image, as above: | |
| # WebKit's system packages are about 94 MB, which took nine minutes from the mirror on a slow day. | |
| # | |
| # The files run side by side, like the Chromium list's, but eight at a time rather than a worker | |
| # per core: each file opens Chromium and WebKit, and sixteen workers' 32 browsers on 16 cores | |
| # starved the tests that wait on a clock (a hold's Retry-After, a menu's load). This job began | |
| # with one file and ran its list one file after another; by 24 November it held 30 files in two | |
| # engines each, took 35 minutes and was the whole length of a run. Add a new file to this one | |
| # list, not a step of its own: a step runs after the one before it. Only a run narrowed to some of | |
| # a file's tests (`-t`) gets its own step. scripts/ci-changes.test.ts holds every real-browser | |
| # job to this. | |
| # | |
| # A pull request from a fork runs this on a standard runner, 4 cores, not 16. Eight workers there | |
| # are 16 browsers on 4 cores: tests ran out of their 5 seconds, WebKit's renderer died mid-page, | |
| # and "Thinking" was measured at twice its 200 ms, on every outside pull request that touched the | |
| # app. So on that runner the list runs two files at a time, each test gets 15 seconds by default | |
| # instead of 5, and the job has an hour. A test's own timeout and every bound a test asserts stay | |
| # as they are. On the larger runners nothing changes: eight workers, 5 seconds, 30 minutes. | |
| # | |
| # In shards, one runner each, as the suite is: one job took 16 to 17 minutes before the browser tests | |
| # no job had ever named were added, and every file is still named here once. `bun test --shard` | |
| # deals the sorted list out in turn. A run is as long as its slowest shard, and a shard as long as | |
| # its slowest file: artifacts-screens, about 11 minutes. | |
| app-browser-webkit: | |
| name: app (real browser, WebKit) (shard ${{ matrix.shard }} of ${{ strategy.job-total }}) | |
| needs: changes | |
| strategy: | |
| # Every shard runs to the end, so one red run names every failing test, as the suite's do. | |
| fail-fast: false | |
| matrix: | |
| shard: [1, 2, 3] | |
| # On a pull request, only when the app, what it imports or its tests change (scripts/ci-changes.ts, | |
| # app_browser_webkit). A merge group and main run it every time. | |
| if: needs.changes.outputs.app_browser_webkit == 'true' | |
| runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || 'openbot-ubuntu-16core' }} | |
| # Usually about 8 minutes on the larger runners, and 35 on a fork's runner. | |
| timeout-minutes: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 60 || 30 }} | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| env: | |
| PLAYWRIGHT_IMAGE: mcr.microsoft.com/playwright:v1.62.1-noble@sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e | |
| TEST_WORKERS: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && '2' || '8' }} | |
| TEST_TIMEOUT_MS: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && '15000' || '5000' }} | |
| TEST_SHARD: ${{ matrix.shard }}/${{ strategy.job-total }} | |
| 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: | | |
| # One file per line, sorted: pull requests that each add a file then merge cleanly. | |
| files=( | |
| app/tests/access-requests-layout.test.tsx | |
| app/tests/add-custom-mcp-card-layout.test.tsx | |
| app/tests/admin-notion-one-press-layout.test.tsx | |
| app/tests/admin-path-layout.test.tsx | |
| app/tests/admin-request-notify-layout.test.tsx | |
| app/tests/another-account-layout.test.tsx | |
| app/tests/app-frame-skeleton-still.test.tsx | |
| app/tests/approval-answered-layout.test.tsx | |
| app/tests/approval-left-carry-on-browser.test.tsx | |
| app/tests/approval-rules-layout.test.tsx | |
| app/tests/artifact-bridge-browser.test.ts | |
| app/tests/artifact-collab-browser.test.tsx | |
| app/tests/artifact-error-notice-layout.test.tsx | |
| app/tests/artifact-events-socket.test.ts | |
| app/tests/artifact-kinds-browser.test.tsx | |
| app/tests/artifact-sharing-screens-layout.test.tsx | |
| app/tests/artifact-sign-in-refusal-browser.test.tsx | |
| app/tests/artifact-tool-cards-browser.test.tsx | |
| app/tests/artifacts-kit.test.ts | |
| app/tests/artifacts-screens.test.tsx | |
| app/tests/board-row-layout.test.tsx | |
| app/tests/bot-file-links-browser.test.tsx | |
| app/tests/bot-long-instructions-layout.test.tsx | |
| app/tests/bot-owner-lists-layout.test.tsx | |
| app/tests/bot-screen-sharp.test.tsx | |
| app/tests/bots-panel-start-conversation.test.tsx | |
| app/tests/browse-apps-pages.test.tsx | |
| app/tests/browse-steps-layout.test.tsx | |
| app/tests/bug-reports-layout.test.tsx | |
| app/tests/carry-on-carried-turn-browser.test.tsx | |
| app/tests/chunk-recovery.test.tsx | |
| app/tests/command-card-layout.test.tsx | |
| app/tests/component-bots-layout.test.tsx | |
| app/tests/composer-dictation-language.test.tsx | |
| app/tests/composer-keeps-draft-browser.test.tsx | |
| app/tests/composer-send-while-dictating.test.tsx | |
| app/tests/composer-touch-return.test.tsx | |
| app/tests/computer-panel-phone-layout.test.tsx | |
| app/tests/computer-starting-browser.test.tsx | |
| app/tests/connected-bot-mistakes-layout.test.tsx | |
| app/tests/conversation-access-ended.test.tsx | |
| app/tests/conversation-allowances-layout.test.tsx | |
| app/tests/conversation-kept-browser.test.tsx | |
| app/tests/conversation-reopen-end.test.tsx | |
| app/tests/conversation-reply-toolbar-layout.test.tsx | |
| app/tests/conversation-switch.test.tsx | |
| app/tests/delete-account-layout.test.tsx | |
| app/tests/desktop-window-sign-in.test.tsx | |
| app/tests/finished-run-no-stopped-notice-browser.test.tsx | |
| app/tests/first-message-thinking.test.tsx | |
| app/tests/free-runs-heads-up-layout.test.tsx | |
| app/tests/group-conversation-gutter.test.tsx | |
| app/tests/hand-back-row-layout.test.tsx | |
| app/tests/home-holds-still.test.tsx | |
| app/tests/home-no-answer.test.tsx | |
| app/tests/long-names-layout.test.tsx | |
| app/tests/long-turn-reopen.test.tsx | |
| app/tests/member-rows-long-names.test.tsx | |
| app/tests/move-to-cloud-settings.test.tsx | |
| app/tests/moved-apps-reconnect.test.tsx | |
| app/tests/moved-elsewhere.test.tsx | |
| app/tests/name-the-admins-layout.test.tsx | |
| app/tests/new-conversation-picked-model.test.tsx | |
| app/tests/offline-conversation-layout.test.tsx | |
| app/tests/one-press-connect-layout.test.tsx | |
| app/tests/organization-held-actions.test.tsx | |
| app/tests/organization-held-recovery.test.tsx | |
| app/tests/organization-held-reload.test.tsx | |
| app/tests/organization-members-remove.test.tsx | |
| app/tests/organization-moving.test.tsx | |
| app/tests/organization-removed.test.tsx | |
| app/tests/organization-unavailable-admin-pages.test.tsx | |
| app/tests/organization-unavailable-chat.test.tsx | |
| app/tests/organization-unavailable-pages.test.tsx | |
| app/tests/people-lists.test.tsx | |
| app/tests/plan-notices-layout.test.tsx | |
| app/tests/question-answer-prompt-browser.test.tsx | |
| app/tests/queue-send-now-layout.test.tsx | |
| app/tests/reached-as-the-person-browser.test.tsx | |
| app/tests/rejoin-fresh-token-browser.test.tsx | |
| app/tests/renderer-crash.test.ts | |
| app/tests/renewal-keeps-typing-browser.test.tsx | |
| app/tests/roster-working.test.tsx | |
| app/tests/routine-run-now-layout.test.tsx | |
| app/tests/run-ended-unheard-layout.test.tsx | |
| app/tests/section-strip-routines.test.tsx | |
| app/tests/select-long-names-layout.test.tsx | |
| app/tests/select-scrolls-layout.test.tsx | |
| app/tests/self-contained-account-menu.test.tsx | |
| app/tests/service-terms.test.tsx | |
| app/tests/settings-tool-cards-admin-layout.test.tsx | |
| app/tests/settings-tool-cards-core.test.tsx | |
| app/tests/settings-tool-cards-personal.test.tsx | |
| app/tests/sidebar-current-row.test.tsx | |
| app/tests/sidebar-window-buttons.test.tsx | |
| app/tests/sidebar-zoom-drag.test.tsx | |
| app/tests/sign-in-reconnect-layout.test.tsx | |
| app/tests/sign-in-returns-there.test.tsx | |
| app/tests/sign-in-with-apple-layout.test.tsx | |
| app/tests/slider-look.test.tsx | |
| app/tests/stay-signed-in-browser.test.tsx | |
| app/tests/step-rows-layout.test.tsx | |
| app/tests/stopped-command-layout.test.tsx | |
| app/tests/stopped-turn-dismiss-browser.test.tsx | |
| app/tests/strip-version-layout.test.tsx | |
| app/tests/table-export-browser.test.tsx | |
| app/tests/team-connections-directory-layout.test.tsx | |
| app/tests/too-many-follow-ups.test.tsx | |
| app/tests/transcript-table-end.test.tsx | |
| app/tests/trusted-types-build.test.ts | |
| app/tests/trusted-types.test.ts | |
| app/tests/web-push-browser.test.tsx | |
| app/tests/what-if-handle-browser.test.tsx | |
| app/tests/work-folded-layout.test.tsx | |
| app/tests/workspace-snapshots-layout.test.tsx | |
| ) | |
| 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 --parallel="$TEST_WORKERS" --timeout="$TEST_TIMEOUT_MS" --shard="$TEST_SHARD" "${files[@]}" | |
| # 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. Once, on the first shard. | |
| - if: matrix.shard == 1 | |
| 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" | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # 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' }} | |
| timeout-minutes: 25 # usually about 6 minutes | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| 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 | |
| # Connect your AI's key field and tab row, in WebKit, the engine the Mac window draws with. | |
| # Only those tests: the rest of the file runs in Chromium in the step above. | |
| - 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 --env OPENBOT_APP_ENGINE=webkit \ | |
| "$PLAYWRIGHT_IMAGE" \ | |
| bun test src/setupLayout.browser.test.ts -t "the key field and the tab row" | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # 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' }} | |
| timeout-minutes: 15 # usually about 4 minutes | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| strategy: | |
| # Every shard runs to the end, so one red run names every failing test, not just the first | |
| # shard's. On a pull request the first failure anywhere stops the whole run instead | |
| # (.github/actions/stop-on-failure). | |
| 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 | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # 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 | |
| # A standard runner: it adds up the shards' counts in seconds. | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 # usually seconds | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| # 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 | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # 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' | |
| # A standard runner: a few files, already run there for forks (scripts/ci-runners.test.ts). | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 # installs the browsers it needs, then runs a few files | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| 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 | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| 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 }} | |
| timeout-minutes: 15 # usually about a minute; room for a macOS runner to arrive | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Not macOS in a merge group: the organization has about two macOS runners, and with every | |
| # merge group asking for one the merge queue waited on them. A pull request that touches | |
| # what this reads runs it on macOS, and main's run of the merged commit runs it there too, | |
| # since the queue's run never passed it (scripts/ci-changes.ts). | |
| os: [macos-latest, windows-latest] | |
| exclude: | |
| - os: ${{ github.event_name == 'merge_group' && 'macos-latest' || 'none' }} | |
| 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 | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # 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' | |
| # A standard runner: under a minute on either (scripts/ci-runners.test.ts). | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 # usually under a minute | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.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 | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # 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' | |
| # A standard runner: about a minute a harness on either, and fifteen of them a run, so on | |
| # the 16-core pool they took fifteen of its slots for seconds each (scripts/ci-runners.test.ts). | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 # usually under 3 minutes for the slowest harness | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| harness: | |
| - agent-crewai | |
| - agent-claude-sdk | |
| - agent-openai-agents | |
| - 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 | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # 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' | |
| # A standard runner: under a minute on either (scripts/ci-runners.test.ts). | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 # usually under a minute | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| 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 5 --retry-all-errors -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 | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| 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' }} | |
| timeout-minutes: 10 # usually under a minute | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| 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 | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # 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. A merge group runs them | |
| # when it changes what they read (the `components` rule in scripts/ci-changes.ts: the agents' | |
| # directories, shared/, the Dockerfiles and this list). On main and through the release's | |
| # workflow_call they always run, so main keeps the build cache warm. `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 | |
| timeout-minutes: 5 # usually seconds | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| # Not in a merge group that changes nothing they read: its images are the ones main built. | |
| needs: changes | |
| if: >- | |
| (github.event_name != 'pull_request' && github.event_name != 'merge_group') || | |
| (github.event_name == 'merge_group' && needs.changes.outputs.components == 'true') || | |
| 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" | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # 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. A merge group's ref is | |
| # gone once it merges, so it reads and never writes for the same reason. | |
| component-dockerfiles: | |
| name: component dockerfile (${{ matrix.image }}) | |
| needs: component-list | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 # seconds from main's cache; a cold build of the largest image takes longer | |
| permissions: | |
| contents: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| strategy: | |
| # Every image is built to the end, so one red run names every Dockerfile that broke. On a pull | |
| # request the first failure anywhere stops the whole run instead (.github/actions/stop-on-failure). | |
| 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' && github.event_name != 'merge_group' && format('type=gha,mode=max,ignore-error=true,scope={0}-amd64', matrix.image) || '' }} | |
| provenance: false | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # CHANGELOG.md is the release's, and a pull request's note is in its description, under | |
| # `## Changelog` (scripts/release-note-check.ts): this fails a pull request that changes | |
| # CHANGELOG.md, other than the release's own, one with no note, and one that deprecates part of | |
| # the API without naming it in its note. It runs last, after every other job, and reads the | |
| # description then, so a description edited while the tests run is the one checked; one edited | |
| # after the run re-runs it (release-note-edited.yml). Running last, its stop step | |
| # (.github/actions/stop-on-failure) has no other job to cancel, but it cancels this one, so a | |
| # failed check most often reports cancelled. A pull request only: a merge group's pull requests | |
| # each passed it, and nothing else has a description. | |
| release-note: | |
| name: release note | |
| if: ${{ !cancelled() && github.event_name == 'pull_request' }} | |
| 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] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 # usually seconds | |
| permissions: | |
| contents: read | |
| # To read the pull request's description and files. | |
| pull-requests: read | |
| # To cancel this run at its first failure (.github/actions/stop-on-failure). | |
| actions: write | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| # The check and what it imports, and the action its last step uses. | |
| sparse-checkout: | | |
| scripts/release-note-check.ts | |
| scripts/release-notes.ts | |
| shared/api-deprecations.ts | |
| shared/client-version.ts | |
| package.json | |
| release-policy.json | |
| .github/actions/stop-on-failure | |
| sparse-checkout-cone-mode: false | |
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.4.3 | |
| no-cache: true | |
| - name: CHANGELOG.md is the release's, and the description has the note | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: bun scripts/release-note-check.ts | |
| # On a failure, cancels the run at once (.github/actions/stop-on-failure). | |
| - if: failure() | |
| uses: $/.github/actions/stop-on-failure | |
| # 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 | |
| # A standard runner: it reads the other jobs' results in seconds. On the 16-core pool a | |
| # cancelled run's verify, which runs always(), queued for a runner and held the run's | |
| # concurrency group, so the pull request's newer run sat pending behind a run nobody wanted. | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 # usually seconds | |
| if: always() | |
| needs: [changes, release-note, 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] | |
| permissions: | |
| contents: read | |
| # To name the jobs that failed. A job that stopped its run at its first failure is recorded | |
| # as cancelled (.github/actions/stop-on-failure), so the results above do not say which. | |
| actions: read | |
| steps: | |
| - name: Require every check | |
| env: | |
| RESULTS: ${{ join(needs.*.result, ' ') }} | |
| CHANGES: ${{ needs.changes.result }} | |
| QUEUE_RUN: ${{ needs.changes.outputs.queue_run }} | |
| GH_TOKEN: ${{ github.token }} | |
| REPOSITORY: ${{ github.repository }} | |
| RUN_ID: ${{ github.run_id }} | |
| RUN_ATTEMPT: ${{ github.run_attempt }} | |
| # What failed, one line per job, from this attempt's jobs (every page, slurped). A job that | |
| # stopped its run at its first failure is recorded as cancelled, and so is every job it | |
| # stopped, `changes` included, so the results above cannot say which job it was: it is | |
| # the cancelled job with a failed step, and the first such is named as the one that | |
| # stopped the run. Left out, as consequences of an earlier failure: a job that started | |
| # after the stop (only always() jobs start on a cancelled run), and `tests` when a shard | |
| # did not pass, since its check is that every shard passed. A job's full name is one line, | |
| # never split at its commas ("format, lint, types"). A run cancelled with no failed job | |
| # says so, so it is not mistaken for a stop (scripts/verify-failures.test.ts). | |
| NAME_FAILURES: | | |
| def line: "\(.name) failed at \"\(.failed_at.name)\""; | |
| [.[].jobs[]] as $jobs | |
| | ([$jobs[] | select(any(.steps[]?; .conclusion == "failure")) | |
| | . + {failed_at: first(.steps[] | select(.conclusion == "failure"))}] | |
| | sort_by(.failed_at.completed_at)) as $failed | |
| | any($jobs[]; (.name | startswith("tests (shard ")) and .conclusion != "success" and .conclusion != "skipped") as $shard_down | |
| | [$failed[] | select(.name != "tests" or ($shard_down | not))] as $failed | |
| | [$failed[] | select(.conclusion == "cancelled")] as $stoppers | |
| | if ($stoppers | length) > 0 then | |
| $stoppers[0] as $stop | |
| | "Stopped the run: \($stop | line). Its log shows why; the jobs it stopped are marked cancelled.", | |
| ($failed[] | select(.name != $stop.name and .started_at <= $stop.failed_at.completed_at) | "Also failed: \(line).") | |
| elif ($failed | length) > 0 then | |
| $failed[] | "Failed: \(line)." | |
| elif any($jobs[]; .conclusion == "cancelled") then | |
| "No job failed: the run was cancelled from outside it, by a newer push, the merge queue or a person." | |
| else empty end | |
| run: | | |
| set -euo pipefail | |
| echo "$RESULTS" | |
| if [ -n "$QUEUE_RUN" ]; then | |
| echo "::notice::Tested in the merge queue: $QUEUE_RUN" | |
| echo "Tested in the merge queue: $QUEUE_RUN" >> "$GITHUB_STEP_SUMMARY" | |
| fi | |
| # What failed, named before every red exit (NAME_FAILURES above says how), on the job and | |
| # at the top of the run's summary. | |
| name_failures() { | |
| local named line | |
| if ! named=$(gh api --paginate "repos/$REPOSITORY/actions/runs/$RUN_ID/attempts/$RUN_ATTEMPT/jobs?per_page=100" \ | |
| | jq -rs "$NAME_FAILURES"); then | |
| echo "::warning::Could not read this run's jobs to name the ones that failed." | |
| return 0 | |
| fi | |
| while IFS= read -r line; do | |
| [ -n "$line" ] || continue | |
| echo "::error::$line" | |
| echo "- $line" >> "$GITHUB_STEP_SUMMARY" | |
| done <<< "$named" | |
| } | |
| if [ "$CHANGES" != success ]; then | |
| name_failures | |
| 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) ;; | |
| *) | |
| name_failures | |
| echo "::error::A required check reported $result"; exit 1 ;; | |
| esac | |
| done |