ci(pipeline): Cache nox virtual environments to reduce CI execution time #3364

Open
opened 2026-04-05 14:38:11 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: ci/cache-nox-environments
  • Commit Message: ci(pipeline): cache nox virtual environments to reduce CI execution time
  • Milestone: (backlog — see note below)
  • Parent Epic: #1678

Background

The ci.yml workflow currently caches the uv packages, which is great. However, it does not cache the nox virtual environments themselves, which are created in the .nox directory.

Caching the .nox directory between CI runs would provide an additional speed-up, as nox would not have to create the virtual environments and install the dependencies from scratch for every job. This would be especially beneficial for the larger jobs such as unit_tests and integration_tests.

Subtasks

  • In ci.yml, add a actions/cache step (before the nox invocation) to cache the .nox directory, with a cache key derived from pyproject.toml and uv.lock (e.g. nox-${{ runner.os }}-${{ hashFiles('pyproject.toml', 'uv.lock') }})
  • Add a restore-keys fallback so partial cache hits are still useful
  • Verify that the cached nox environments are correctly restored and used in subsequent CI runs (inspect cache hit/miss logs)
  • Confirm all 11 CI jobs still pass after the caching change

Definition of Done

  • The .nox directory is cached and restored between CI runs using a content-addressed key
  • Cache key is based on pyproject.toml and uv.lock to ensure correctness on dependency changes
  • CI pipeline execution time is measurably reduced (document before/after timings)
  • The CI pipeline still passes successfully with no quality gate regressions
  • All nox stages pass

Backlog note: This issue was discovered during autonomous operation
on milestone v3.7.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Automated by CleverAgents Bot
Supervisor: Test Infrastructure | Agent: ca-new-issue-creator

## Metadata - **Branch**: `ci/cache-nox-environments` - **Commit Message**: `ci(pipeline): cache nox virtual environments to reduce CI execution time` - **Milestone**: *(backlog — see note below)* - **Parent Epic**: #1678 ## Background The `ci.yml` workflow currently caches the `uv` packages, which is great. However, it does not cache the `nox` virtual environments themselves, which are created in the `.nox` directory. Caching the `.nox` directory between CI runs would provide an additional speed-up, as `nox` would not have to create the virtual environments and install the dependencies from scratch for every job. This would be especially beneficial for the larger jobs such as `unit_tests` and `integration_tests`. ## Subtasks - [ ] In `ci.yml`, add a `actions/cache` step (before the nox invocation) to cache the `.nox` directory, with a cache key derived from `pyproject.toml` and `uv.lock` (e.g. `nox-${{ runner.os }}-${{ hashFiles('pyproject.toml', 'uv.lock') }}`) - [ ] Add a restore-keys fallback so partial cache hits are still useful - [ ] Verify that the cached nox environments are correctly restored and used in subsequent CI runs (inspect cache hit/miss logs) - [ ] Confirm all 11 CI jobs still pass after the caching change ## Definition of Done - [ ] The `.nox` directory is cached and restored between CI runs using a content-addressed key - [ ] Cache key is based on `pyproject.toml` and `uv.lock` to ensure correctness on dependency changes - [ ] CI pipeline execution time is measurably reduced (document before/after timings) - [ ] The CI pipeline still passes successfully with no quality gate regressions - [ ] All nox stages pass > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.7.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Backlog (unchanged)
  • Story Points: 3 — M
  • MoSCoW: Could Have — CI pipeline optimization. Caching nox virtual environments reduces CI execution time.
  • Parent Epic: #1678 (CI Execution Time Optimization)

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Backlog (unchanged) - **Story Points**: 3 — M - **MoSCoW**: Could Have — CI pipeline optimization. Caching nox virtual environments reduces CI execution time. - **Parent Epic**: #1678 (CI Execution Time Optimization) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#3364
No description provided.