Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/actions/setup-nix/action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: "Setup Nix"
description: "Install Nix and configure cache"
inputs:
python-version:
description: "Python version for cache key (e.g., python311, python313)"
required: false
default: "python311"
runs:
using: "composite"
steps:
Expand All @@ -11,8 +16,8 @@ runs:
- name: Cache Nix store
uses: nix-community/cache-nix-action@b426b118b6dc86d6952988d396aa7c6b09776d08 # v7
with:
primary-key: nix-${{ runner.os }}

- name: Load Nix development environment
shell: bash
run: nix develop --command true
primary-key: nix-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('flake.lock', 'uv.lock', 'pyproject.toml', 'src/**/*.py') }}
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Including src/**/*.py in the cache key will cause unnecessary cache invalidations on every source code change. This cache is for the Nix store (dependencies), not source code. Dependencies only change when lock files or pyproject.toml change, but source code changes on nearly every commit. This defeats the caching purpose and will slow CI rather than speed it up.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/actions/setup-nix/action.yaml, line 19:

<comment>Including `src/**/*.py` in the cache key will cause unnecessary cache invalidations on every source code change. This cache is for the Nix store (dependencies), not source code. Dependencies only change when lock files or `pyproject.toml` change, but source code changes on nearly every commit. This defeats the caching purpose and will slow CI rather than speed it up.</comment>

<file context>
@@ -16,7 +16,7 @@ runs:
       uses: nix-community/cache-nix-action@b426b118b6dc86d6952988d396aa7c6b09776d08 # v7
       with:
-        primary-key: nix-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles(&#39;flake.lock&#39;, &#39;uv.lock&#39;) }}
+        primary-key: nix-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles(&#39;flake.lock&#39;, &#39;uv.lock&#39;, &#39;pyproject.toml&#39;, &#39;src/**/*.py&#39;) }}
         restore-prefixes-first-match: |
           nix-${{ runner.os }}-${{ inputs.python-version }}-
</file context>
Suggested change
primary-key: nix-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('flake.lock', 'uv.lock', 'pyproject.toml', 'src/**/*.py') }}
primary-key: nix-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('flake.lock', 'uv.lock', 'pyproject.toml') }}
Fix with Cubic

restore-prefixes-first-match: |
nix-${{ runner.os }}-${{ inputs.python-version }}-
nix-${{ runner.os }}-
gc-max-store-size: 4G
21 changes: 6 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.13"]
include:
- python-version: "3.11"
sync-extras: "--all-extras"
- python-version: "3.13"
sync-extras: "--all-extras"
python-version: ["python311", "python313"]
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
Expand All @@ -48,18 +43,17 @@ jobs:

- name: Setup Nix
uses: ./.github/actions/setup-nix

- name: Install dependencies
run: nix develop --command just install ${{ matrix.sync-extras }}
with:
python-version: ${{ matrix.python-version }}

- name: Run Lint
run: nix develop --command just lint
run: nix develop .#${{ matrix.python-version }} --command just lint

- name: Run Ty
run: nix develop --command just ty
run: nix develop .#${{ matrix.python-version }} --command just ty

- name: Run Tests
run: nix develop --command just test
run: nix develop .#${{ matrix.python-version }} --command just test

coverage:
runs-on: ubuntu-latest
Expand All @@ -73,9 +67,6 @@ jobs:
- name: Setup Nix
uses: ./.github/actions/setup-nix

- name: Install dependencies
run: nix develop --command just install --all-extras

- name: Run Tests with Coverage
run: nix develop --command just coverage

Expand Down
102 changes: 87 additions & 15 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading