ci: consolidate workflows, build once per run #57

Merged
codinget merged 1 commits from ci-cache-speedup into main 2026-07-04 00:57:15 +02:00
Owner

Summary

Every job in the old checks.yml/test-node.yml/test-browser.yml independently repeated checkout + tailscale submodule clone + npm ci + (for 5 of 7 jobs) a full Turbo build. There was no caching anywhere, which is most of why formatting checks took ~2 min and full test runs took up to 9.5 min.

Live smoke tests against this Gitea instance (pushed as throwaway workflows, since removed) found:

  • actions/cache@v4 (and setup-node's built-in cache: npm, same API) times out against the built-in cache proxy — a server-side issue, not fixable from workflow YAML.
  • actions/upload-artifact@v4/download-artifact@v4 refuse to run at all (GHES detection).
  • actions/upload-artifact@v3/download-artifact@v3 work correctly.

So this consolidates the 3 workflow files into one ci.yml:

  • install does the real work once (submodule clone, npm ci, build) and hands node_modules + Turbo's cache off via v3 artifacts.
  • typecheck/typetest/node-tests/browser-tests (needs: install) restore those artifacts instead of reinstalling/rebuilding from scratch.
  • lint/format never touched the submodule or build output, so they drop that step and stay independent for fast feedback.
  • Shared checkout+submodule+setup-node steps are now a composite action (.gitea/actions/setup) instead of duplicated 7 times.
  • A concurrency group cancels superseded runs on the same ref.

Also fixed along the way: packages/xml and packages/vfs pin a newer local TypeScript than the workspace root, installed by npm as nested packages/{xml,vfs}/node_modules/typescript. The install job's node_modules archive now includes those per-package overrides, not just the root — the first version missed them and caused spurious typecheck failures in those two packages.

Cross-run caching (reusing a previous run's install/build) isn't available until the Gitea cache backend is fixed server-side — that's a separate follow-up, not part of this PR. Someone with server access should check the [actions] cache config in app.ini and the runner's ACTIONS_CACHE_URL.

Test plan

  • install, typecheck, typetest, node-tests, browser-tests, lint, format all pass on this PR
  • Confirm downstream jobs actually restore artifacts and Turbo shows cache hits rather than rebuilding (observed 12/25 and 12/22 cached tasks in typecheck/node-tests runs)

Known unrelated flake observed during iteration: a pre-existing timing-sensitive test suite in packages/tsconnect-worker/src/worker.test.ts occasionally fails under load (different assertions each time); not caused by this change.

## Summary Every job in the old `checks.yml`/`test-node.yml`/`test-browser.yml` independently repeated checkout + tailscale submodule clone + `npm ci` + (for 5 of 7 jobs) a full Turbo build. There was no caching anywhere, which is most of why formatting checks took ~2 min and full test runs took up to 9.5 min. Live smoke tests against this Gitea instance (pushed as throwaway workflows, since removed) found: - `actions/cache@v4` (and `setup-node`'s built-in `cache: npm`, same API) times out against the built-in cache proxy — a server-side issue, not fixable from workflow YAML. - `actions/upload-artifact@v4`/`download-artifact@v4` refuse to run at all (GHES detection). - `actions/upload-artifact@v3`/`download-artifact@v3` work correctly. So this consolidates the 3 workflow files into one `ci.yml`: - `install` does the real work once (submodule clone, `npm ci`, build) and hands `node_modules` + Turbo's cache off via v3 artifacts. - `typecheck`/`typetest`/`node-tests`/`browser-tests` (`needs: install`) restore those artifacts instead of reinstalling/rebuilding from scratch. - `lint`/`format` never touched the submodule or build output, so they drop that step and stay independent for fast feedback. - Shared checkout+submodule+setup-node steps are now a composite action (`.gitea/actions/setup`) instead of duplicated 7 times. - A `concurrency` group cancels superseded runs on the same ref. Also fixed along the way: `packages/xml` and `packages/vfs` pin a newer local TypeScript than the workspace root, installed by npm as nested `packages/{xml,vfs}/node_modules/typescript`. The `install` job's `node_modules` archive now includes those per-package overrides, not just the root — the first version missed them and caused spurious typecheck failures in those two packages. Cross-run caching (reusing a previous run's install/build) isn't available until the Gitea cache backend is fixed server-side — that's a separate follow-up, not part of this PR. Someone with server access should check the `[actions]` cache config in `app.ini` and the runner's `ACTIONS_CACHE_URL`. ## Test plan - [x] `install`, `typecheck`, `typetest`, `node-tests`, `browser-tests`, `lint`, `format` all pass on this PR - [x] Confirm downstream jobs actually restore artifacts and Turbo shows cache hits rather than rebuilding (observed 12/25 and 12/22 cached tasks in typecheck/node-tests runs) Known unrelated flake observed during iteration: a pre-existing timing-sensitive test suite in `packages/tsconnect-worker/src/worker.test.ts` occasionally fails under load (different assertions each time); not caused by this change.
codinget added the Agentic
Agent
claude-sonnet-4-6
3
labels 2026-07-03 23:28:39 +02:00
codinget added 1 commit 2026-07-04 00:40:36 +02:00
ci: consolidate workflows, build once per run
CI / lint (pull_request) Successful in 1m24s
CI / format (pull_request) Successful in 1m26s
CI / install (pull_request) Successful in 4m16s
CI / typetest (pull_request) Successful in 1m0s
CI / typecheck (pull_request) Successful in 1m29s
CI / browser-tests (pull_request) Successful in 2m48s
CI / node-tests (pull_request) Successful in 28s
CI / format (push) Successful in 1m6s
CI / lint (push) Successful in 1m6s
CI / install (push) Successful in 4m33s
CI / typecheck (push) Successful in 1m40s
CI / typetest (push) Successful in 1m42s
CI / node-tests (push) Successful in 1m38s
CI / browser-tests (push) Successful in 3m11s
1aa26fd33e
Every job in the old checks.yml/test-node.yml/test-browser.yml
independently repeated checkout + tailscale submodule clone + npm ci,
and 5 of 7 also independently rebuilt the whole workspace via Turbo.
There was no caching anywhere.

Live smoke tests against this Gitea instance found actions/cache
(and setup-node's built-in cache: npm, same API) times out against
the built-in cache proxy - a server-side issue, not fixable from
workflow YAML - and actions/upload-artifact/download-artifact v4
refuse to run at all (GHES detection). v3 of the artifact actions
work correctly, so they're used as the handoff mechanism instead.

.gitea/workflows/checks.yml, test-node.yml, and test-browser.yml are
merged into one ci.yml. A new `install` job does the real work once
(submodule clone, npm ci, build) and hands node_modules plus Turbo's
local cache off via v3 artifacts to typecheck/typetest/node-tests/
browser-tests (all `needs: install`), instead of every job reinstalling
and rebuilding from scratch. lint/format never touched the submodule
or build output, so they drop that step and stay independent for fast
feedback. The shared checkout+submodule+setup-node preamble is now a
composite action, .gitea/actions/setup/action.yml (composite actions
require the repo to already be checked out, so actions/checkout stays
a separate first step in every job). A concurrency group cancels
superseded runs on the same ref.

The node_modules archive step must include per-package node_modules
overrides, not just the root: packages/xml and packages/vfs pin a
newer local TypeScript than the workspace root, installed by npm as
nested packages/{xml,vfs}/node_modules/typescript. Missing those in
the archive caused those two packages to silently typecheck against
the wrong TypeScript version.

Cross-run caching (reusing a previous run's install/build) isn't
available until the Gitea instance's cache backend is fixed
server-side - that's a separate, out-of-scope follow-up.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
codinget force-pushed ci-cache-speedup from 93d6cb1c06 to 1aa26fd33e 2026-07-04 00:40:36 +02:00 Compare
codinget marked the pull request as ready for review 2026-07-04 00:40:50 +02:00
codinget merged commit 1aa26fd33e into main 2026-07-04 00:57:15 +02:00
codinget deleted branch ci-cache-speedup 2026-07-04 00:57:15 +02:00
codinget added
Agent
claude-sonnet-5
and removed
Agent
claude-sonnet-4-6
3
labels 2026-07-20 03:38:44 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: webnet/webnet#57