new vcpkg caching action for ci

This commit is contained in:
Green Sky 2025-05-07 19:37:29 +02:00
parent 3b5874739b
commit 9d2f2a0344
No known key found for this signature in database
GPG Key ID: DBE05085D874AB4A

View File

@ -40,6 +40,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
# vcpkg caching action
actions: read
contents: read
strategy: strategy:
matrix: matrix:
platform: platform:
@ -74,17 +79,17 @@ jobs:
- name: Install Dependencies (host) - name: Install Dependencies (host)
run: sudo apt update && sudo apt -y install cmake pkg-config nasm run: sudo apt update && sudo apt -y install cmake pkg-config nasm
- name: Export GitHub Actions cache environment variables - name: Restore vcpkg cache
uses: actions/github-script@v7 id: vcpkg-cache
uses: TAServers/vcpkg-cache@v3
with: with:
script: | token: ${{secrets.GITHUB_TOKEN}}
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install Dependencies (target) - name: Install Dependencies (target)
env: env:
ANDROID_NDK_HOME: ${{steps.setup_ndk.outputs.ndk-path}} ANDROID_NDK_HOME: ${{steps.setup_ndk.outputs.ndk-path}}
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" VCPKG_FEATURE_FLAGS: "binarycaching"
VCPKG_BINARY_SOURCES: "clear;files,${{steps.vcpkg-cache.outputs.path}},readwrite"
run: vcpkg install --overlay-triplets=vcpkg_android_triplets --triplet ${{matrix.platform.vcpkg_toolkit}} libsodium opus libvpx libpng libjpeg-turbo freetype run: vcpkg install --overlay-triplets=vcpkg_android_triplets --triplet ${{matrix.platform.vcpkg_toolkit}} libsodium opus libvpx libpng libjpeg-turbo freetype
# vcpkg scripts root /usr/local/share/vcpkg/scripts # vcpkg scripts root /usr/local/share/vcpkg/scripts
@ -143,16 +148,16 @@ jobs:
with: with:
submodules: recursive submodules: recursive
- name: Export GitHub Actions cache environment variables - name: Restore vcpkg cache
uses: actions/github-script@v7 id: vcpkg-cache
uses: TAServers/vcpkg-cache@v3
with: with:
script: | token: ${{secrets.GITHUB_TOKEN}}
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install Dependencies - name: Install Dependencies
env: env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" VCPKG_FEATURE_FLAGS: "binarycaching"
VCPKG_BINARY_SOURCES: "clear;files,${{steps.vcpkg-cache.outputs.path}},readwrite"
run: vcpkg install pkgconf:x64-windows libsodium:x64-windows-static pthreads:x64-windows-static opus:x64-windows-static libvpx:x64-windows-static zstd:x64-windows-static libwebp:x64-windows-static libpng:x64-windows-static libjpeg-turbo:x64-windows-static freetype:x64-windows-static run: vcpkg install pkgconf:x64-windows libsodium:x64-windows-static pthreads:x64-windows-static opus:x64-windows-static libvpx:x64-windows-static zstd:x64-windows-static libwebp:x64-windows-static libpng:x64-windows-static libjpeg-turbo:x64-windows-static freetype:x64-windows-static
# setup vs env # setup vs env