From 6a2fdc6e73138a646d60706176483a56a95391dd Mon Sep 17 00:00:00 2001 From: John McCall Date: Sat, 5 Sep 2026 10:03:07 -0400 Subject: [PATCH 1/3] ci: cache pip downloads for WSL ansible-base install 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> --- .github/workflows/ansible-test-windows.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ansible-test-windows.yml b/.github/workflows/ansible-test-windows.yml index 9bd44493..e768f773 100644 --- a/.github/workflows/ansible-test-windows.yml +++ b/.github/workflows/ansible-test-windows.yml @@ -81,6 +81,11 @@ jobs: PYTHON: python3 CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # zizmor: ignore[secrets-outside-env] -- Codecov token needed for coverage uploads; environment protection would block PR-triggered runs WORKSPACE: ${{ github.workspace }} + # Relative to github.workspace, which is also the default cwd for wsl-bash steps below. + # wsl.exe transparently maps that Windows path into WSL via drvfs, so the same files on + # disk can be cached directly by actions/cache (running on the Windows host) without + # reaching into the WSL rootfs (where pip's real default cache dir would otherwise live). + PIP_CACHE_DIR: .pip-cache steps: - name: Check out code @@ -155,6 +160,14 @@ jobs: $ws = ConvertTo-LinuxPathCrappy -LiteralPath "$env:WORKSPACE" Add-Content -LiteralPath $env:GITHUB_ENV -Value "GHWS=$ws" + - name: Cache pip downloads/wheels + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: ${{ env.PIP_CACHE_DIR }} + key: ${{ runner.os }}-pip-${{ matrix.ansible }} + restore-keys: | + ${{ runner.os }}-pip- + # Override break-sys-pkg defaults, because we don't need to bother with python venv for CI # # ansible-core devel requires Python >= 3.13 (see pyproject.toml on the devel branch), From 0bd49195b77586f2924f28030f918f760a7c3f30 Mon Sep 17 00:00:00 2001 From: John McCall Date: Sat, 5 Sep 2026 10:08:36 -0400 Subject: [PATCH 2/3] ci: forward PIP_CACHE_DIR into WSL and use a rolling cache key 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> --- .github/workflows/ansible-test-windows.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ansible-test-windows.yml b/.github/workflows/ansible-test-windows.yml index e768f773..e7ad229c 100644 --- a/.github/workflows/ansible-test-windows.yml +++ b/.github/workflows/ansible-test-windows.yml @@ -86,6 +86,10 @@ jobs: # disk can be cached directly by actions/cache (running on the Windows host) without # reaching into the WSL rootfs (where pip's real default cache dir would otherwise live). PIP_CACHE_DIR: .pip-cache + # wsl-bash launches `wsl.exe bash ...` directly, which does NOT inherit arbitrary Windows + # env vars; only names listed in WSLENV get imported into the guest. /u makes this + # one-way (Windows -> Linux), no path translation needed since the value is relative. + WSLENV: PIP_CACHE_DIR/u steps: - name: Check out code @@ -164,9 +168,9 @@ jobs: uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ env.PIP_CACHE_DIR }} - key: ${{ runner.os }}-pip-${{ matrix.ansible }} + key: ${{ runner.os }}-pip-${{ matrix.ansible }}-${{ matrix.group }}-${{ github.run_id }} restore-keys: | - ${{ runner.os }}-pip- + ${{ runner.os }}-pip-${{ matrix.ansible }}-${{ matrix.group }}- # Override break-sys-pkg defaults, because we don't need to bother with python venv for CI # From 8326cfc8d9039f493fef8de80c2087c2a4edc217 Mon Sep 17 00:00:00 2001 From: John McCall Date: Sat, 5 Sep 2026 10:48:54 -0400 Subject: [PATCH 3/3] ci: use lowlysre/config-ansible-remote-action for WinRM setup 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> --- .github/workflows/ansible-test-windows.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ansible-test-windows.yml b/.github/workflows/ansible-test-windows.yml index e7ad229c..8cf95099 100644 --- a/.github/workflows/ansible-test-windows.yml +++ b/.github/workflows/ansible-test-windows.yml @@ -105,12 +105,7 @@ jobs: net localgroup Administrators admin /add - name: Set up the runner for PowerShell remoting - shell: powershell - run: | - # Pinned to a commit in the current home of this script; latest version at - # https://github.com/ansible/ansible-documentation/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 - $sb = [ScriptBlock]::Create((New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/ansible/ansible-documentation/b8cf495929aa200a11abc7468d1fb6cd9c0e1613/examples/scripts/ConfigureRemotingForAnsible.ps1')) - & $sb -Verbose -ForceNewSSLCert 4>&1 + uses: lowlysre/config-ansible-remote-action@89ef42324b31e17b10f7e520508a1cab14c2ef33 # v1.0.0 - name: Add a hosts entry # zizmor: ignore[misfeature] -- Windows-specific cmd required for hosts file modification shell: cmd