@@ -253,40 +253,53 @@ jobs:
253253 echo "becomes_latest=$becomes_latest" >> "$GITHUB_OUTPUT"
254254 echo "$VERSION becomes the latest release: $becomes_latest."
255255
256- # Whether the full CI suite runs again on the release commit (scripts/release-ci-gate.ts). A release
257- # PR that changes only the release files (the versions, CHANGELOG.md and release-policy.json),
258- # merged onto a commit main's CI passed, has a tree that has already been through every check, so
259- # `checks` below is skipped and that run stands in for it. Anything else in the diff, or a parent
260- # whose CI did not pass, runs the full suite as before. When the suite is skipped, the checks CI
261- # makes that read the release files run here instead, so a changelog or policy edited in the
262- # release PR is still held to them.
256+ # What runs on the release commit (scripts/release-ci-gate.ts): no test runs again on a tree that
257+ # already passed it. The gate looks for a commit whose CI passed (the release commit itself, its
258+ # first parents, or main's) and whose tree differs from the release commit's in nothing a run
259+ # would check differently, and runs only the difference:
260+ #
261+ # - `reuse`, the same tree, a revert back to a tree that passed included: nothing runs again, but
262+ # the support window, which counts from the day of the release.
263+ # - `release-files`, only the versions, CHANGELOG.md and release-policy.json differ: the checks
264+ # that read them run here.
265+ # - `tests`, only those and the suite's test files differ: the release-file checks and types run
266+ # here, and the changed tests, in each engine they run in, in `release tests`.
267+ # - `full`, anything else, or anything it cannot read: `checks` below runs the full suite.
263268 gate :
264269 name : checks needed
265270 needs : [metadata, verify]
266271 if : needs.metadata.outputs.is_release == 'true'
267272 runs-on : ubuntu-latest
268- # The decision waits up to 10 minutes for main's CI on the parent while it is still running
273+ # The decision waits up to 10 minutes for CI still running on a commit that would stand in
269274 # (MAX_WAIT_SECONDS in the script), then the release-file checks below run.
270275 timeout-minutes : 20
271276 permissions :
272277 contents : read
273- # To read main's CI runs.
278+ # To read the CI runs that stand in .
274279 actions : read
275280 outputs :
276281 full_checks : ${{ steps.decide.outputs.full_checks }}
282+ mode : ${{ steps.decide.outputs.mode }}
283+ tests : ${{ steps.decide.outputs.tests }}
284+ browser_tests : ${{ steps.decide.outputs.browser_tests }}
285+ webkit_tests : ${{ steps.decide.outputs.webkit_tests }}
286+ desktop_browser_tests : ${{ steps.decide.outputs.desktop_browser_tests }}
277287 steps :
278- # The release commit and its parent, which the decision compares.
288+ # The release commit and the history it is compared with: its own first parents, and main's
289+ # for a release branch. Without file contents, which the decision fetches for the few files it
290+ # reads; the release commit's own tree is checked out whole.
279291 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
280292 with :
281293 ref : ${{ github.sha }}
282- fetch-depth : 2
294+ fetch-depth : 0
295+ filter : blob:none
283296 persist-credentials : false
284297 - uses : oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
285298 with :
286299 bun-version : 1.4.3
287300 no-cache : true
288301 - id : decide
289- name : Decide whether the full checks run again
302+ name : Decide what runs again
290303 env :
291304 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
292305 run : bun scripts/release-ci-gate.ts "$GITHUB_SHA"
@@ -295,18 +308,22 @@ jobs:
295308 # CI's `format, lint, types` job formats and lints package.json and the policy, and checks the
296309 # versions the release moved still agree with each other.
297310 - name : Format and lint
298- if : steps.decide.outputs.full_checks == 'false '
311+ if : steps.decide.outputs.mode == 'release-files' || steps.decide.outputs.mode == 'tests '
299312 run : |
300313 set -euo pipefail
301314 bun run format:check
302315 bun run lint
316+ # The changed tests are type checked, as CI's `format, lint, types` would.
317+ - name : Types
318+ if : steps.decide.outputs.mode == 'tests'
319+ run : bun run typecheck
303320 - name : Desktop version tracks the release version
304- if : steps.decide.outputs.full_checks == 'false '
321+ if : steps.decide.outputs.mode == 'release-files' || steps.decide.outputs.mode == 'tests '
305322 run : bun desktop/scripts/desktop-version.ts check
306323 # Every test that reads the changelog or the policy, found by name so a new one is included
307324 # without anybody adding it here.
308325 - name : The tests that read CHANGELOG.md and release-policy.json
309- if : steps.decide.outputs.full_checks == 'false '
326+ if : steps.decide.outputs.mode == 'release-files' || steps.decide.outputs.mode == 'tests '
310327 run : |
311328 set -euo pipefail
312329 tests=()
@@ -329,9 +346,50 @@ jobs:
329346 if : steps.decide.outputs.full_checks == 'false'
330347 run : bun scripts/support-window.ts check --releases "$RUNNER_TEMP/releases.json"
331348
332- # The same checks CI runs, against the commit being published, unless `gate` found the release
333- # commit is the release files on a commit main's CI passed. This or that run is the gate: nothing is
334- # built or tagged unless one of them passed on this tree.
349+ # The test files the release commit changed from the tree whose CI passed, with every test that
350+ # names one, when `gate` found nothing else changed: each in the engines CI runs it in, as CI's
351+ # `tests (changed files)` runs them (scripts/ci-run-tests.ts). A browser test runs in Chromium, and
352+ # in WebKit too when it asks for it; the desktop setup window's from desktop/.
353+ release-tests :
354+ name : release tests
355+ needs : [metadata, verify, gate]
356+ if : needs.metadata.outputs.is_release == 'true' && needs.gate.outputs.mode == 'tests'
357+ runs-on : ubuntu-latest
358+ timeout-minutes : 25 # installs the browsers it needs, then runs a few files
359+ permissions :
360+ contents : read
361+ steps :
362+ - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
363+ with :
364+ ref : ${{ github.sha }}
365+ persist-credentials : false
366+ - uses : oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
367+ with :
368+ bun-version : 1.4.3
369+ no-cache : true
370+ # The same installs as CI's, since a changed file can be anywhere the suite looks.
371+ - run : bun install --frozen-lockfile
372+ - run : bun install --frozen-lockfile
373+ working-directory : agent-mastra
374+ - run : bun install --frozen-lockfile
375+ working-directory : desktop
376+ - name : Install Chromium
377+ if : needs.gate.outputs.browser_tests != '[]' || needs.gate.outputs.desktop_browser_tests != '[]'
378+ run : bunx playwright-core install --with-deps --no-shell chromium
379+ - name : Install WebKit
380+ if : needs.gate.outputs.webkit_tests != '[]'
381+ run : bunx playwright-core install --with-deps webkit
382+ - name : Run the changed tests
383+ env :
384+ TESTS : ${{ needs.gate.outputs.tests }}
385+ BROWSER_TESTS : ${{ needs.gate.outputs.browser_tests }}
386+ WEBKIT_TESTS : ${{ needs.gate.outputs.webkit_tests }}
387+ DESKTOP_BROWSER_TESTS : ${{ needs.gate.outputs.desktop_browser_tests }}
388+ run : bun scripts/ci-run-tests.ts
389+
390+ # The same checks CI runs, against the commit being published, unless `gate` found a tree whose CI
391+ # passed that differs from this one only in the release files and tests. This or that run is the
392+ # gate: nothing is built or tagged unless one of them passed on this tree.
335393 checks :
336394 needs : [metadata, verify, gate]
337395 if : needs.metadata.outputs.is_release == 'true' && needs.gate.outputs.full_checks == 'true'
@@ -354,15 +412,18 @@ jobs:
354412 # decision made in `verify`, the same one that marks the GitHub release Latest: whoever pulls
355413 # `latest` gets the newest stable release, never a candidate, a beta or an older patch.
356414 #
357- # After `checks` passed, or after `gate` passed having decided `checks` need not run. Nothing else:
358- # a `checks` skipped for any other reason, or a `gate` that failed, publishes nothing.
415+ # After `checks` passed, or after `gate` passed having decided `checks` need not run, and the
416+ # changed tests passed when it decided they run. Nothing else: a `checks` or `release tests`
417+ # skipped for any other reason, or a `gate` that failed, publishes nothing.
359418 images :
360- needs : [metadata, verify, gate, checks]
419+ needs : [metadata, verify, gate, release-tests, checks]
361420 if : >-
362421 !cancelled() && needs.metadata.outputs.is_release == 'true' &&
363422 needs.verify.result == 'success' && needs.gate.result == 'success' &&
364423 (needs.checks.result == 'success' ||
365- (needs.checks.result == 'skipped' && needs.gate.outputs.full_checks == 'false'))
424+ (needs.checks.result == 'skipped' && needs.gate.outputs.full_checks == 'false' &&
425+ (needs.release-tests.result == 'success' ||
426+ (needs.release-tests.result == 'skipped' && needs.gate.outputs.mode != 'tests'))))
366427 uses : $/.github/workflows/images.yml
367428 with :
368429 ref : ${{ github.sha }}
0 commit comments