Composite actions: restore/save the devenv eval cache on the self-hosted Forgejo runner
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-25 16:46:35 +03:00
save feat: add devenv cache setup/save composite actions 2026-09-25 16:46:35 +03:00
setup feat: add devenv cache setup/save composite actions 2026-09-25 16:46:35 +03:00
README.md feat: add devenv cache setup/save composite actions 2026-09-25 16:46:35 +03:00

devenv-ci

Composite actions for CI jobs that run devenv shell on the self-hosted Forgejo runner (the devenv label). They move the project-local eval cache between the shared cache volume (/var/lib/ci-cache, mounted at /cache) and the checkout, so a fresh job does not pay for a cold devenv evaluation.

The cache is stored as devenv-eval.tar and replaced with an atomic rename, so concurrent jobs of one repository never read a half-written SQLite cache.

Usage

jobs:
  check:
    runs-on: devenv
    container:
      volumes:
        - /nix:/nix:O
        - /var/lib/ci-cache:/cache
    env:
      XDG_CACHE_HOME: /cache/xdg
    steps:
      - uses: actions/checkout@v4

      - uses: actions/devenv-ci/setup@v1

      - run: devenv shell -- task go:build
      - run: devenv shell -- task go:test

      - uses: actions/devenv-ci/save@v1
        if: always()
  • setup must run before the first devenv shell.
  • save must keep if: always() so the cache is published even when a check failed.
  • uses: actions/... resolves to this instance because its DEFAULT_ACTIONS_URL points at git.derfenix.pro.
  • The actions assume the runner-provided job environment (the devenv label, the /nix overlay and the /cache volume); outside it they are no-ops or failures.