Skip to content
Documentation

Docs / Adapter commands / Moon

Moon adapter

Reuse Moon build results through a shared REAPI cache while the tool keeps control of task identities and local execution.

Command
boringcache moon
Protocol
REAPI gRPC action cache and content-addressable store; cache only
Action
mode: moon

How the adapter works

Native client configuration

Set verify-integrity to control Moon's output digest checks. The adapter uses gRPC, an empty instance name, and no compression. Use a pinned Moon version; task inputs, outputs, and branch configuration stay in the project.

Shared cache lifecycle

The adapter selects the cache tag, starts a loopback REAPI endpoint, runs the client, and drains cache writes before shutdown. A cache miss runs the task locally.

Read and write policy

Read-only runs do not publish cache entries. Trusted writable runs may publish. Unknown or misplaced adapter options fail before cache startup.

Set up Moon

Commit this configuration and run boringcache moon. Omit command when the Action should prepare caching for several later commands. Set verify-integrity to control Moon's output digest checks. The adapter uses gRPC, an empty instance name, and no compression. Use a pinned Moon version; task inputs, outputs, and branch configuration stay in the project.

workspace = "my-org/my-project"

[adapters.moon]
tag = "moon-build"
command = ["moon", "run", ":build"]

[adapters.moon.options]
verify-integrity = true

Before the first run

  • Install the project's Moon version before running the adapter.
  • Review boringcache moon --dry-run --json before the first build.
  • Remote execution is not provided; use an empty REAPI instance name.

Configuration and cache behavior

Output symlinks

In testing with Moon 2.5.6, relative symlinks inside declared output directories were restored as regular files. Do not rely on symlink preservation for those outputs with this version.

Building inside Docker? Follow the Docker REAPI tool-cache setup to select this tool, its cache tag, and its read/write policy.

Use the same adapter in GitHub Actions

A committed adapter command runs in this Action step. Without one, the Action prepares caching for later tool commands and removes its temporary configuration after stopping the client and cache service.

.github/workflows/ci.yml
- uses: boringcache/one@6b680206950cc926444c045302370653fae538f1 # v1.50.0
  with:
    trust-policy: auto
    mode: moon

Approve the repository through Connect CI and grant the job contents: read and id-token: write. The Action uses that Machine connection. Pull requests restore by default; trusted jobs may publish. See the authentication example in the GitHub Actions reference for scoped credentials when OIDC is unavailable.

GitHub Actions reference

Benchmarks

Zitadel builds the same upstream commits with BoringCache and Depot Cache on the same runner classes.

Zitadel

moon

Benchmark →

Identity platform with Go services and TypeScript apps.

Average restore, build and save · lower is better

GitHub runner

4 vCPU · 16 GB · Ubuntu 24.04 x86-64

BoringCache
72.9 s 30 builds
Depot Cache
68.1 s 30 builds
Same CPU model

Builds of one commit can land on different CPU models. These ratios use only the build pairs where both caches ran on the same model; above 1.00× means BoringCache's total time over those pairs was lower.

Depot Cache vs BoringCache
0.97× · 11 of 30
6 CPU models recorded
BoringCache · Remote cache
AMD EPYC 7763 (16 builds) · AMD EPYC 9V74 (6 builds) · AMD EPYC 9V45 (3 builds) · Intel Xeon 6973P-C (2 builds) · Intel Xeon Platinum 8573C (2 builds) · Intel Xeon Platinum 8370C (1 build)
Depot Cache
AMD EPYC 7763 (17 builds) · Intel Xeon Platinum 8573C (5 builds) · AMD EPYC 9V45 (4 builds) · Intel Xeon 6973P-C (2 builds) · AMD EPYC 9V74 (2 builds)
Cold and warm builds

Each table is one workflow run with one build per cache. A row marked Different CPU ran on another CPU model than BoringCache at the same level, so part of its time difference can come from the hardware.

One cold and warm build per cache
Cache Cold Warm CPU
BoringCache Remote cache 76.5 s 60.7 s Cold: AMD EPYC 7763 · Warm: AMD EPYC 9V74
Depot Cache 71.5 s 30.5 s Cold: Intel Xeon Platinum 8573C · Warm: AMD EPYC 7763 Different CPU

Cache hits

BoringCache · GitHub runner · 4 vCPU

99.7% of 32,116 lookups over 30 builds

Served from the runner
Under 1 ms per read
Read from cache
334 MB

Tool reference

Check the tool's own reference when you need cache-key rules, build settings, or version-specific behavior.

All adapter commands

Compare every supported command, protocol, and Action mode in one place.

Adapter command index →

Need help or found something unclear? Open an issue or browse the CLI repo.