Skip to content

fix: use jq hash of deps+vcpkg ref for precise cache keying #21

fix: use jq hash of deps+vcpkg ref for precise cache keying

fix: use jq hash of deps+vcpkg ref for precise cache keying #21

Workflow file for this run

name: WebFrame CI/CD Pipeline
on:
push:
permissions:
contents: write
packages: write
env:
VCPKG_REF: '2026.01.16'
jobs:
test:
name: Unit Tests
runs-on: ubuntu-latest
env:
VCPKG_BINARY_SOURCES: >-
clear;files,${{ github.workspace }}/vcpkg-test-cache,readwrite
steps:
- name: Checkout vcpkg
uses: actions/checkout@v6
with:
repository: microsoft/vcpkg
path: vcpkg
ref: ${{ env.VCPKG_REF }}
- name: Checkout code
uses: actions/checkout@v6
with:
repository: maxtek6/WebFrame
path: WebFrame
ref: ${{ github.ref }}
- name: Compute vcpkg cache hash
id: vcpkg-hash
shell: bash
run: |
hash=$(jq -cj '{features,dependencies}' WebFrame/vcpkg.json | cat - WebFrame/vcpkg-configuration.json | sha256sum | awk '{print $1}')
echo "value=${hash}" >> $GITHUB_OUTPUT
- name: "Restore VCPKG cache"
id: restore-test-cache
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}/vcpkg-test-cache
key: vcpkg-test-cache-${{ env.VCPKG_REF }}-${{ steps.vcpkg-hash.outputs.value }}
restore-keys: vcpkg-test-cache-${{ env.VCPKG_REF }}
- name: CMake Build
run: |
cmake -S WebFrame -B build -DBUILD_TESTING=ON -DBUILD_RUNTIME=OFF -DVCPKG_ROOT=${{ github.workspace }}/vcpkg
cd build
make -j4
make test
- name: "Save VCPKG cache"
if: steps.restore-test-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/vcpkg-test-cache
key: vcpkg-test-cache-${{ env.VCPKG_REF }}-${{ steps.vcpkg-hash.outputs.value }}
build:
needs: test
name: Build Runtime
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
env:
VCPKG_BINARY_SOURCES: >-
clear;files,${{ github.workspace }}/vcpkg-${{ matrix.os }},readwrite
steps:
- name: Checkout vcpkg
uses: actions/checkout@v6
with:
repository: microsoft/vcpkg
path: vcpkg
ref: ${{ env.VCPKG_REF }}
- name: Checkout code
uses: actions/checkout@v6
with:
repository: maxtek6/WebFrame
path: WebFrame
ref: ${{ github.ref }}
- name: Compute vcpkg cache hash
id: vcpkg-hash
shell: bash
run: |
hash=$(jq -cj '{features,dependencies}' WebFrame/vcpkg.json | cat - WebFrame/vcpkg-configuration.json | sha256sum | awk '{print $1}')
echo "value=${hash}" >> $GITHUB_OUTPUT
- name: "Restore VCPKG cache"
id: restore-build-cache
uses: actions/cache/restore@v5
with:
path: ${{ github.workspace }}/vcpkg-${{ matrix.os }}
key: vcpkg-${{ matrix.os }}-${{ env.VCPKG_REF }}-${{ steps.vcpkg-hash.outputs.value }}
restore-keys: vcpkg-${{ matrix.os }}-${{ env.VCPKG_REF }}
- name: Ubuntu setup
if: matrix.os == 'ubuntu-latest'
run: ./WebFrame/.github/scripts/ubuntu_setup.sh
- name: MacOS setup
if: matrix.os == 'macos-latest'
run: ./WebFrame/.github/scripts/osx_setup.sh
- name: CMake Build
run: |
cmake -S WebFrame -B build -DBUILD_TESTING=OFF -DBUILD_RUNTIME=ON -DVCPKG_ROOT=${{ github.workspace }}/vcpkg
cmake --build build
- name: "Save VCPKG cache"
if: steps.restore-build-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v5
with:
path: ${{ github.workspace }}/vcpkg-${{ matrix.os }}
key: vcpkg-${{ matrix.os }}-${{ env.VCPKG_REF }}-${{ steps.vcpkg-hash.outputs.value }}