From 4a57fe43923fc1e6c1104e5d6f7778653d6621ad Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Mon, 7 Jul 2025 18:12:12 +0200 Subject: [PATCH] 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. --- .github/workflows/lagom-template.yml | 6 ++++++ CMakePresets.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lagom-template.yml b/.github/workflows/lagom-template.yml index 1ca402dd1ed..d72be0aabd7 100644 --- a/.github/workflows/lagom-template.yml +++ b/.github/workflows/lagom-template.yml @@ -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 diff --git a/CMakePresets.json b/CMakePresets.json index 64253eb5bc2..f053a8ccab2 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -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": {