CI+CMake: Enable vcpkg source assets cache

I've set up a shared vcpkg source assets cache using Azurite. By
default, it runs in read-only mode allowing anyone who builds Ladybird
to use the cache to speed up downloads of source tarballs. This should
alleviate some of the more slower vcpkgs downloads I've been seeing
lately.

CI runs on master put vcpkg in readwrite mode, updating the cache for
everyone.
This commit is contained in:
Jelle Raaijmakers 2025-07-07 18:12:12 +02:00 committed by Andrew Kaster
commit 4a57fe4392
Notes: github-actions[bot] 2025-07-09 21:34:14 +00:00
2 changed files with 8 additions and 1 deletions

View file

@ -128,6 +128,9 @@ jobs:
- name: Create Build Environment
if: ${{ inputs.os_name != 'Windows' && inputs.build_preset != 'Fuzzers_CI' }}
working-directory: ${{ github.workspace }}
env:
VCPKG_CACHE_SAS: ${{ github.ref == 'refs/heads/master' && secrets.VCPKG_CACHE_SAS || '' }}
VCPKG_CACHE_MODE: ${{ github.ref == 'refs/heads/master' && 'write' || '' }}
run: |
cmake --preset ${{ inputs.build_preset }} -B Build \
${{ steps.build-parameters.outputs.cmake_options }} \
@ -138,6 +141,9 @@ jobs:
- name: Create Build Environment (Windows)
if: ${{ inputs.os_name == 'Windows' }}
working-directory: ${{ github.workspace }}
env:
VCPKG_CACHE_SAS: ${{ github.ref == 'refs/heads/master' && secrets.VCPKG_CACHE_SAS || '' }}
VCPKG_CACHE_MODE: ${{ github.ref == 'refs/heads/master' && 'write' || '' }}
run: |
cmake --preset ${{ inputs.build_preset }} -B Build

View file

@ -22,7 +22,8 @@
"environment": {
"LADYBIRD_SOURCE_DIR": "${fileDir}",
"VCPKG_ROOT": "${fileDir}/Build/vcpkg",
"VCPKG_BINARY_SOURCES": "clear;files,${fileDir}/Build/caches/vcpkg-binary-cache,readwrite;$penv{VCPKG_BINARY_SOURCES}"
"VCPKG_BINARY_SOURCES": "clear;files,${fileDir}/Build/caches/vcpkg-binary-cache,readwrite;$penv{VCPKG_BINARY_SOURCES}",
"X_VCPKG_ASSET_SOURCES": "clear;x-azurl,https://vcpkg-cache.app.ladybird.org/ladybird/source-assets/,$penv{VCPKG_CACHE_SAS},read$penv{VCPKG_CACHE_MODE}"
},
"vendor": {
"jetbrains.com/clion": {