Skip to content

Cache pip dependencies using requirements.txt as cache key#69

Merged
jovnc merged 2 commits intogit-mastery:mainfrom
jovnc:chore/cache-ci-dependencies
Mar 16, 2026
Merged

Cache pip dependencies using requirements.txt as cache key#69
jovnc merged 2 commits intogit-mastery:mainfrom
jovnc:chore/cache-ci-dependencies

Conversation

@jovnc
Copy link
Collaborator

@jovnc jovnc commented Mar 15, 2026

Summary

Fixes #68

  • Hash your requirements.txt to generate a cache key
  • On a cache hit: restore the pip download cache before pip install runs, so packages are installed from disk rather than re-downloaded
  • On a cache miss (e.g. first run, or after requirements.txt changes): run normally and save the result to cache for the next run

Note: The arch-build job in publish.yml was intentionally left unchanged, it runs pip inside a Docker container (archlinux:base-devel), so setup-python's host-level cache doesn't reach it.

Verification

  • CI action to download pip dependencies should be faster (from ~20s down to ~1s)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to speed up CI runs by enabling pip dependency caching in GitHub Actions and by pinning dependencies in requirements.txt so the cache key changes only when dependencies change.

Changes:

  • Pin all dependencies in requirements.txt (moving from loose specifiers to exact versions).
  • Enable actions/setup-python pip caching in CI workflows (test.yml, test-pr.yml, publish.yml).

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
requirements.txt Converts dependencies to a fully pinned list to stabilize cache keys.
.github/workflows/test.yml Enables pip caching for the main test workflow.
.github/workflows/test-pr.yml Enables pip caching for PR-targeted E2E tests.
.github/workflows/publish.yml Enables pip caching for publish/build jobs that run pip on the host runner.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jovnc jovnc merged commit 66c95c6 into git-mastery:main Mar 16, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Speed up CI by caching dependencies

2 participants