CI selection and caches
The CI workflow runs on pull requests and on every push to main. The
Select checks job computes one plan with full Git history. Checks always
runs. The Postgres, browser, and LaTeX engine jobs start when the plan selects
their suites. The browser job runs two shards in parallel when both have suites.
A newer push to a pull request cancels that pull request's older run. Runs on
main are never canceled, so each commit there has its own result.
On pull requests, the selector diffs against the pull request base SHA. Selection uses the merge-base diff, including deleted paths and both sides of renames. Missing history selects every check.
On pushes to main, the workflow sets CI_FULL_RUN=true and every check runs
with the full Turbo task set. Each commit on main is checked as merged, which catches
breakage from merge order or direct pushes that a pull request diff would miss.
These runs also save Turbo caches in the main scope, which pull requests can
restore.
Check inputs
For scoped pull requests, Turbo type checks and tests use --affected with
TURBO_SCM_BASE set to the pull request base SHA. Turbo finds the Go compiler through
go.work. Repository link checks, bun run lint:js, and bun fmt --check run
once from the root, including on documentation changes.
Changes to shared packages, the lockfile, root configuration, CI configuration,
root scripts, environment files, Wrangler configuration, generated binding types,
or schema files select the full current set. Unknown root inputs also select
all checks. Changes confined to documentation (apps/docs/content/docs/,
README.md, .agents/, .zed/, LICENSE) skip package tests and browser
suites. Changes to apps/docs app code or tooling select docs typecheck,
static build (./out), and smoke check (which verifies routes, trailing-slash
redirects, static search, and llms.txt against Wrangler's static assets
server) without running web, compiler, or browser suites. Production deploys
export ./out and deploy the texfolia-docs Worker with
bun run --cwd apps/docs deploy. A web unit test change selects web checks
without integration suites.
Runtime web changes select every suite and production-assets because browser suites exercise the whole app. The map stays broad until narrower runtime dependencies can be proven. Changes confined to a mapped integration test select only its owners in the table below. Unknown web test helpers select every suite and production-assets. Any change to the compiler selects the engine suites.
Unit tests verify suite routing and browser shard coverage.
| Suite | Test inputs under apps/web/test | Additional inputs | Job | Production build | Chromium |
|---|---|---|---|---|---|
| settings | settings.ts | Runtime web inputs | Postgres | No | No |
| pricing | pricing.ts | Runtime web inputs | Postgres | Yes | Yes |
| login | login.ts | Runtime web inputs | Browser | No | Yes |
| editor-keymaps | editor-keymaps.ts, editor-keymaps/ | Runtime web inputs | Browser | No | Yes |
| spelling | spelling.ts, spelling/ | Runtime web inputs | Browser | No | Yes |
| synctex | synctex.ts, fixtures/synctex/, editor-runtime/ | Runtime web inputs | Browser | No | Yes |
| themes | theme-preview.ts, editor-runtime/ | Runtime web inputs | Browser | No | Yes |
| editor-runtime | editor-runtime.ts, editor-runtime/, pdf-fixture.ts | Runtime web inputs | Browser | No | Yes |
| editor-features | editor-features.ts, editor-runtime/, pdf-fixture.ts | Runtime web inputs | Browser | No | Yes |
| workspace-accessibility | workspace-accessibility.ts, editor-runtime/, pdf-fixture.ts | Runtime web inputs | Browser | No | Yes |
| compile-engine | compile-engine.ts | Runtime web inputs, anything in the compiler | LaTeX engine | No | No |
| workspace-upload | workspace-upload.ts, editor-runtime/ | Runtime web inputs, anything in the compiler | LaTeX engine | No | Yes |
| database | postgres.ts, postgres/ | Runtime web inputs | Postgres | No | No |
| compile-route | compile-route.ts, compile-route/ | Runtime web inputs | Postgres | No | No |
| ai-billing | ai-billing.ts | Runtime web inputs | Postgres | No | No |
| assistant | ai-assistant.ts | Runtime web inputs | Postgres | Yes | Yes |
| collaboration | collaboration.ts, collaboration/, collaboration-cache.ts, collaboration-cache/ | Runtime web inputs | Postgres | No | Yes |
| workspace-metadata | workspace-metadata.ts | Runtime web inputs | Postgres | Yes | Yes |
| ui-overhaul | ui-overhaul.ts, pdf-fixture.ts | Runtime web inputs | Postgres | Yes | Yes |
| git | git-integration.ts, git/ | Runtime web inputs | Postgres | No | No |
| source-storage | source-storage.ts, source-storage/, worker-integration.ts | Runtime web inputs | Postgres | No | No |
| projects | projects.ts, projects/, worker-integration.ts | Runtime web inputs | Postgres | No | No |
| production-assets | production-assets.ts, login.ts, pdf-fixture.ts | Runtime web inputs | Postgres | Yes | Yes |
The browser rows are the existing end-to-end coverage. There is no separate
e2e package script in the current workflow. Compiler-only Go changes run the
compiler checks and the engine suites, and skip web production assets, Postgres,
and the browser job. Shared package
changes, including the path-policy fixture in packages/contracts, run every
check.
The selection job logs its plan. Run the selector regression cases with
bun run test:repo.
test:billing stays outside CI because it needs Stripe sandbox credentials.
LaTeX engine
The LaTeX engine job builds apps/compiler/Dockerfile, starts the image, and
runs go test -tags integration against it before its suites: every engine
builds a paper with a bibliography, and documents try to run commands and read
another project. Its layers are cached through GitHub Actions, so a change to
the Go code rebuilds only the last ones. A change to texlive.profile or an
earlier layer installs TeX Live again, which takes about ten minutes.
Lint
bun run lint:js uses Oxlint. .oxlintrc.json configures linting and excludes
generated files. bunfig.toml configures formatting.
bun run check:repo also checks that links between Markdown files reach an
existing file and heading.
Cache behavior
The shared setup action installs the Bun version pinned in package.json.
It caches the Bun executable and package downloads, then runs
bun install --frozen-lockfile.
GitHub Actions restores Turbo artifacts from .turbo/cache. Checks and Postgres
keep separate archives. Browser and engine jobs share an archive keyed by the
workspace packages, Bun version, lockfile, and build configuration. A change
to app code alone can reuse the same workspace archive. Turbo still checks
each task's hash after restoration. The docs build caches its static export,
which is what the smoke test and deployment consume.
Turbo uses strict environment mode for cacheable tasks. Web builds hash their Cloudflare, Wrangler, Vite, and public environment variables. Development and deployment tasks receive the caller's full environment. The Go tests hash their path-policy fixture. Setup-go caches modules and compiled objects.
Chromium binaries are cached by runner OS, architecture, and Playwright version. The installer also checks for the required Linux system libraries. Browser and database integration suites run directly.
The Postgres job shares one production web build across asset checks and any selected suites that use the built app. The browser and engine jobs build only the workspace dependencies of web.