Skip to Content
Texfolia Docs

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.

SuiteTest inputs under apps/web/testAdditional inputsJobProduction buildChromium
settingssettings.tsRuntime web inputsPostgresNoNo
pricingpricing.tsRuntime web inputsPostgresYesYes
loginlogin.tsRuntime web inputsBrowserNoYes
editor-keymapseditor-keymaps.ts, editor-keymaps/Runtime web inputsBrowserNoYes
spellingspelling.ts, spelling/Runtime web inputsBrowserNoYes
synctexsynctex.ts, fixtures/synctex/, editor-runtime/Runtime web inputsBrowserNoYes
themestheme-preview.ts, editor-runtime/Runtime web inputsBrowserNoYes
editor-runtimeeditor-runtime.ts, editor-runtime/, pdf-fixture.tsRuntime web inputsBrowserNoYes
editor-featureseditor-features.ts, editor-runtime/, pdf-fixture.tsRuntime web inputsBrowserNoYes
workspace-accessibilityworkspace-accessibility.ts, editor-runtime/, pdf-fixture.tsRuntime web inputsBrowserNoYes
compile-enginecompile-engine.tsRuntime web inputs, anything in the compilerLaTeX engineNoNo
workspace-uploadworkspace-upload.ts, editor-runtime/Runtime web inputs, anything in the compilerLaTeX engineNoYes
databasepostgres.ts, postgres/Runtime web inputsPostgresNoNo
compile-routecompile-route.ts, compile-route/Runtime web inputsPostgresNoNo
ai-billingai-billing.tsRuntime web inputsPostgresNoNo
assistantai-assistant.tsRuntime web inputsPostgresYesYes
collaborationcollaboration.ts, collaboration/, collaboration-cache.ts, collaboration-cache/Runtime web inputsPostgresNoYes
workspace-metadataworkspace-metadata.tsRuntime web inputsPostgresYesYes
ui-overhaului-overhaul.ts, pdf-fixture.tsRuntime web inputsPostgresYesYes
gitgit-integration.ts, git/Runtime web inputsPostgresNoNo
source-storagesource-storage.ts, source-storage/, worker-integration.tsRuntime web inputsPostgresNoNo
projectsprojects.ts, projects/, worker-integration.tsRuntime web inputsPostgresNoNo
production-assetsproduction-assets.ts, login.ts, pdf-fixture.tsRuntime web inputsPostgresYesYes

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.

On this page