Skip to content

CI cache

Use this guide when CI should prepare Frigg state or verify that repository indexing still succeeds.

Pin Frigg so the binary and cache format change intentionally:

name: Frigg
on:
pull_request:
push:
branches: [main]
env:
FRIGG_VERSION: 0.9.0
FRIGG_INSTALL_DIR: ${{ github.workspace }}/.frigg-bin
jobs:
frigg:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Frigg
run: |
curl -fsSL https://raw.githubusercontent.com/bnomei/frigg/main/scripts/install.sh \
| FRIGG_VERSION="${FRIGG_VERSION}" FRIGG_INSTALL_DIR="${FRIGG_INSTALL_DIR}" sh
- run: frigg init
- run: frigg index

The installer appends its directory to GITHUB_PATH, so later steps can call frigg directly.

frigg hash prints exactly one machine-readable line:

frigg-hash=<hex>

Inside GitHub Actions, it also appends the same key and value to GITHUB_OUTPUT. Use that fingerprint with the Frigg version and platform to prevent incompatible cache reuse.

name: Frigg
on:
pull_request:
push:
branches: [main]
env:
FRIGG_VERSION: 0.9.0
FRIGG_INSTALL_DIR: ${{ github.workspace }}/.frigg-bin
jobs:
frigg:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Frigg
run: |
curl -fsSL https://raw.githubusercontent.com/bnomei/frigg/main/scripts/install.sh \
| FRIGG_VERSION="${FRIGG_VERSION}" FRIGG_INSTALL_DIR="${FRIGG_INSTALL_DIR}" sh
- name: Compute Frigg cache hash
id: frigg_hash
run: frigg hash
- name: Restore Frigg state
uses: actions/cache/restore@v4
with:
path: .frigg/
key: frigg-${{ runner.os }}-${{ runner.arch }}-${{ env.FRIGG_VERSION }}-${{ steps.frigg_hash.outputs.frigg-hash }}-${{ github.sha }}
restore-keys: |
frigg-${{ runner.os }}-${{ runner.arch }}-${{ env.FRIGG_VERSION }}-${{ steps.frigg_hash.outputs.frigg-hash }}-
- run: frigg init
- run: frigg index --changed
- name: Save Frigg state
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/cache/save@v4
with:
path: .frigg/
key: frigg-${{ runner.os }}-${{ runner.arch }}-${{ env.FRIGG_VERSION }}-${{ steps.frigg_hash.outputs.frigg-hash }}-${{ github.sha }}

Restore before running init and index --changed. Save only from trusted events. Treat .frigg/ as regenerable local runtime state, not source and not a secret store.

Frigg automatically repairs regenerable vector invariants during init and index. It does not migrate incompatible database schema versions. If restored storage reports a schema mismatch or missing required table, delete the restored .frigg/storage.sqlite3 and run a full index:

Terminal window
rm -f .frigg/storage.sqlite3
frigg index

Successful non-interactive logs end with ok init: complete and ok index: complete. A changed-only index may reuse the current snapshot when no files changed.

  • ../frigg/README.md
  • ../frigg/.github/workflows/frigg-install-cache.yml
  • ../frigg/scripts/install.sh
  • ../frigg/crates/cli/src/cli_runtime/commands/hash.rs
  • ../frigg/crates/cli/src/cli_runtime/commands/index.rs
  • ../frigg/crates/cli/src/storage/lifecycle.rs