ci: Cache `vcpkg/downloads` folder in native Windows CI job
What changed, and why it matters
This change only adjusts how Bitcoin Core's automated Windows build system caches downloaded dependencies. It is a routine efficiency improvement with no security relevance.
No security action needed. Treat as a normal CI optimization.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies .github/workflows/ci.yml to cache the vcpkg/downloads directory (excluding downloads/tools) keyed by the hash of vcpkg.json, replacing a previous cache of only downloads/tools keyed by github.run_id. This is a CI/CD storage optimization. There are no code changes to Bitcoin Core itself, no changes to cryptographic logic, no dependency updates, and no privilege or network changes.
Changed components
.github/workflows/ci.ymlInspect captured patch +13 / −10
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b4904255..2b4ac726 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -253,13 +253,14 @@ jobs:
py -3 --version
bash --version
- - name: Restore vcpkg tools cache
- id: vcpkg-tools-cache
+ - name: Restore vcpkg downloads cache
+ id: vcpkg-downloads-cache
uses: actions/cache/restore@v5
with:
- path: ~/AppData/Local/vcpkg/downloads/tools
- key: ${{ github.job }}-vcpkg-tools-${{ github.run_id }}
- restore-keys: ${{ github.job }}-vcpkg-tools-
+ path: |
+ ~/AppData/Local/vcpkg/downloads/*
+ !~/AppData/Local/vcpkg/downloads/tools
+ key: ${{ github.job }}-vcpkg-downloads-${{ hashFiles('vcpkg.json') }}
- name: Restore vcpkg binary cache
uses: actions/cache/restore@v5
@@ -279,13 +280,15 @@ jobs:
path: ~/AppData/Local/vcpkg/archives
key: ${{ steps.vcpkg-binary-cache.outputs.cache-primary-key }}
- - name: Save vcpkg tools cache
+ - name: Save vcpkg downloads cache
uses: actions/cache/save@v5
- # Only save cache from one job as they share tools. If the matrix is expanded to jobs with unique tools, this may need amending.
- if: github.event_name != 'pull_request' && github.ref_name == github.event.repository.default_branch && steps.vcpkg-tools-cache.outputs.cache-hit != 'true' && matrix.job-type == 'standard'
+ # Only save cache from the 'standard' job, as it includes the necessary downloads for other jobs in the matrix. If the matrix is modified, this may need amending.
+ if: github.event_name != 'pull_request' && github.ref_name == github.event.repository.default_branch && steps.vcpkg-binary-cache.outputs.cache-hit != 'true' && steps.vcpkg-downloads-cache.outputs.cache-hit != 'true' && matrix.job-type == 'standard'
with:
- path: ~/AppData/Local/vcpkg/downloads/tools
- key: ${{ steps.vcpkg-tools-cache.outputs.cache-primary-key }}
+ path: |
+ ~/AppData/Local/vcpkg/downloads/*
+ !~/AppData/Local/vcpkg/downloads/tools # Cache the tools once as archives, but not redundantly in extracted form.
+ key: ${{ steps.vcpkg-downloads-cache.outputs.cache-primary-key }}
- name: Build
run: |
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.