Wire Turborepo remote cache to Cloudflare R2 in CI #274

Closed
opened 2026-06-04 20:05:27 +00:00 by steve · 0 comments
Owner

Integrate brunojppb/turbo-cache-server with Cloudflare R2 for Turborepo remote caching in Forgejo/GitHub CI and optional local docker:ci-check.

Problem

CI runs Turborepo with local-only .turbo/ cache inside each runner/container. Repeated check and build tasks cannot reuse artifacts across CI runs.

Goal

Share Turborepo task cache across CI runs via R2-backed remote cache server, and optionally mirror the same setup locally through pnpm docker:ci-check.

Scope

  • Forgejo workflows that run turbo tasks (checks, release-desktop, plugin assets, lapis.md publish)
  • GitHub mirror workflows for lapis.md site
  • Composite actions, shared config scripts, .env.example, docker:ci-check --remote-cache
  • Spec updates under spec/src/80-maintenance/ and spec/src/40-testing/

Non-goals

  • Changing turbo.json task graph
  • Remote cache for workflows without turbo tasks (spec publish, web image, homebrew)
  • Creating the R2 bucket or Forgejo secrets (operator prerequisite)

Acceptance Criteria

  1. Turbo-enabled Forgejo/GitHub jobs start turbo-cache-server@4.0.7 and set TURBO_API, TURBO_TEAM, TURBO_TOKEN.
  2. Container jobs use a service container; macOS release job uses the start-server composite action.
  3. pnpm docker:ci-check --remote-cache (or auto-detect from repo-root .env) runs a sidecar cache server and passes turbo env to the CI container.
  4. Spec documents required secrets, workflow coverage, and local usage.

Implementation Notes

  • Pin ghcr.io/brunojppb/turbo-cache-server:4.0.7.
  • Use S3_REGION=auto for R2.
  • Fixed TURBO_TEAM=lapis-notes for cross-host cache sharing.

Suggested Files or Specs To Inspect

  • .forgejo/workflows/checks.yml
  • scripts/run-lapis-ci-check-lib.mjs
  • spec/src/80-maintenance/release-management.md

Validation Commands

pnpm check:all
make spec-lint
pnpm docker:ci-check --remote-cache --skip-smoke  # with .env configured

Follow-up Tasks

Implementation Summary

Integrated brunojppb/turbo-cache-server@4.0.7 with Cloudflare R2 across Forgejo/GitHub turbo CI jobs via service containers and a macOS start-server composite action; added .env.example, turbo-cache config scripts, docker:ci-check --remote-cache sidecar support, and spec docs. Validated with pnpm check:all and make spec-lint.

Integrate [brunojppb/turbo-cache-server](https://github.com/brunojppb/turbo-cache-server) with Cloudflare R2 for Turborepo remote caching in Forgejo/GitHub CI and optional local `docker:ci-check`. ## Problem CI runs Turborepo with local-only `.turbo/` cache inside each runner/container. Repeated check and build tasks cannot reuse artifacts across CI runs. ## Goal Share Turborepo task cache across CI runs via R2-backed remote cache server, and optionally mirror the same setup locally through `pnpm docker:ci-check`. ## Scope - Forgejo workflows that run turbo tasks (`checks`, `release-desktop`, plugin assets, lapis.md publish) - GitHub mirror workflows for lapis.md site - Composite actions, shared config scripts, `.env.example`, `docker:ci-check --remote-cache` - Spec updates under `spec/src/80-maintenance/` and `spec/src/40-testing/` ## Non-goals - Changing `turbo.json` task graph - Remote cache for workflows without turbo tasks (spec publish, web image, homebrew) - Creating the R2 bucket or Forgejo secrets (operator prerequisite) ## Acceptance Criteria 1. Turbo-enabled Forgejo/GitHub jobs start `turbo-cache-server@4.0.7` and set `TURBO_API`, `TURBO_TEAM`, `TURBO_TOKEN`. 2. Container jobs use a service container; macOS release job uses the start-server composite action. 3. `pnpm docker:ci-check --remote-cache` (or auto-detect from repo-root `.env`) runs a sidecar cache server and passes turbo env to the CI container. 4. Spec documents required secrets, workflow coverage, and local usage. ## Implementation Notes - Pin `ghcr.io/brunojppb/turbo-cache-server:4.0.7`. - Use `S3_REGION=auto` for R2. - Fixed `TURBO_TEAM=lapis-notes` for cross-host cache sharing. ## Suggested Files or Specs To Inspect - `.forgejo/workflows/checks.yml` - `scripts/run-lapis-ci-check-lib.mjs` - `spec/src/80-maintenance/release-management.md` ## Validation Commands ```bash pnpm check:all make spec-lint pnpm docker:ci-check --remote-cache --skip-smoke # with .env configured ``` ## Related Issues ## Follow-up Tasks ## Implementation Summary Integrated brunojppb/turbo-cache-server@4.0.7 with Cloudflare R2 across Forgejo/GitHub turbo CI jobs via service containers and a macOS start-server composite action; added .env.example, turbo-cache config scripts, docker:ci-check --remote-cache sidecar support, and spec docs. Validated with pnpm check:all and make spec-lint. <!-- backlog:task_id=TASK-CI-TURBO-REMOTE-CACHE source_spec=spec/src/80-maintenance/release-management.md -->
steve 2026-06-04 20:05:27 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/lapis#274
No description provided.