ci: cache pip downloads for WSL ansible-base install - #397
Open
lowlydba wants to merge 4 commits into
Open
Conversation
Adds a job-level PIP_CACHE_DIR (.pip-cache, relative to github.workspace) and an actions/cache step keyed on matrix.ansible so pip's cache directory lands on NTFS where actions/cache (running on the Windows host) can reach it. The wsl-bash steps share the same github.workspace cwd via drvfs, so the cache is the literal same files on disk. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The cache variable is not propagated into WSL, and the fixed key prevents future cache updates.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds host-accessible pip caching for Windows/WSL CI.
Changes:
- Configures a workspace-relative pip cache.
- Restores pip downloads and wheels with
actions/cache.
File summaries
| File | Description |
|---|---|
.github/workflows/ansible-test-windows.yml |
Adds pip cache configuration to Windows integration tests. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
wsl-bash launches wsl.exe directly, which only imports Windows env vars listed in WSLENV; without it pip inside WSL kept using ~/.cache/pip. Also switch the cache key to include github.run_id per matrix leg so pip-installed wheels/archives actually get saved on a miss, falling back to the latest matching key via restore-keys instead of one permanently-fixed key that never updates. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replaces the inline ConfigureRemotingForAnsible.ps1 download-and-run step with the reusable composite action, pinned to v1.0.0 (89ef423) by full commit SHA. Same upstream script SHA (b8cf495) is used as this action's default, so behavior is unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ng-wsl-install # Conflicts: # .github/workflows/ansible-test-windows.yml
lowlydba
enabled auto-merge (squash)
September 5, 2026 14:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Install ansible-basestep runs inside a WSL guest and pip-installssetuptools,pypsrp, and an ansible tarball from a GitHub archive URL, with no caching between runs. pip's default cache dir (~/.cache/pip) lives inside the WSL rootfs, whichactions/cachecan't reach from the Windows host.Sets
PIP_CACHE_DIRto.pip-cache, relative togithub.workspace.wsl.exemaps that Windows path into WSL via drvfs, so it's the same files on disk thatactions/cache(running on the Windows host) can key and restore directly, no separate WSL virtual disk involved.wsl-bashlauncheswsl.exedirectly rather than a login shell, soWSLENV: PIP_CACHE_DIR/uis also needed to actually forward the variable into the guest. Cache key includesgithub.run_idpermatrix.ansible/matrix.groupso every run saves a fresh cache instead of getting stuck on the first successful save, withrestore-keysfalling back to the latest matching prefix.setuptools/pypsrpshould get full cache hits. The ansible tarball still rebuilds each time since it's not a normal versioned PyPI package, but the download itself gets reused from cache.Also swaps the inline
ConfigureRemotingForAnsible.ps1download-and-run step forlowlysre/config-ansible-remote-action@v1.0.0, a composite action wrapping the same script at the same pinned commit, pinned here by full commit SHA.Testing
This is a Windows/WSL runner quirk (drvfs path translation,
actions/cacherunning on the host side vs. pip inside the WSL guest) that's hard to verify outside CI. CI on this PR is the actual validation.