-
Notifications
You must be signed in to change notification settings - Fork 0
Description
same relies on a robust caching strategy using a local Content Addressable Store (CAS) located at .same/store and tool resolution caches in .same/cache. Currently, CI/CD pipelines must rebuild the task graph and re-resolve Nix environments on every run, leading to slower build times.
This issue involves implementing a GitHub Action step in our CI workflow to persist the .same directory across runs. This will allow CI agents to share build metadata, input/output hashes, and resolved environment variable sets, significantly reducing compute time for incremental changes.
Goals
- Reduce CI Latency: Skip tasks that have already been executed with identical inputs by restoring the
BuildInfostore. - Persist Environments: Cache resolved Nix tool environments in
.same/cache/environmentsto avoid expensivenix print-dev-envcalls during Phase 1 hydration. - Deterministic Keying: Ensure the cache key accurately reflects changes in tool definitions, dependency locks, and the Nix flake configuration.
Acceptance Criteria
-
The
.github/workflows/ci.ymlfile includes anactions/cachestep that targets the.samedirectory. -
The cache key is generated using a hash of the following files to ensure determinism:
-
**/same.yamland**/same.work.yaml(Task definitions and tool aliases). -
cli/go.sum(Go dependency changes). -
flake.lock(Nix toolchain revisions). -
The cache is restored before the
Generate Go source filesandRun testssteps in the CI workflow. -
The cache is successfully updated/saved after a successful build execution.
-
Verification that a "Cached Run" in CI contains "Skipped (Cached)" in the output for unchanged tasks.