fix: only save vcpkg cache when binary contents have changed #20
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: WebFrame CI/CD Pipeline | |
| on: | |
| push: | |
| permissions: | |
| contents: write | |
| packages: write | |
| 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: '2026.01.16' | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: maxtek6/WebFrame | |
| path: WebFrame | |
| ref: ${{ github.ref }} | |
| - name: "Restore VCPKG cache" | |
| id: restore-test-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{ github.workspace }}/vcpkg-test-cache | |
| key: vcpkg-test-cache-${{ hashFiles('WebFrame/vcpkg.json', 'WebFrame/vcpkg-configuration.json') }} | |
| restore-keys: vcpkg-test-cache | |
| - 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-${{ hashFiles('WebFrame/vcpkg.json', 'WebFrame/vcpkg-configuration.json') }} | |
| 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: '2026.01.16' | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: maxtek6/WebFrame | |
| path: WebFrame | |
| ref: ${{ github.ref }} | |
| - name: "Restore VCPKG cache" | |
| id: restore-build-cache | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: ${{ github.workspace }}/vcpkg-${{ matrix.os }} | |
| key: vcpkg-${{ matrix.os }}-${{ hashFiles('WebFrame/vcpkg.json', 'WebFrame/vcpkg-configuration.json') }} | |
| restore-keys: vcpkg-${{ matrix.os }} | |
| - 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 }}-${{ hashFiles('WebFrame/vcpkg.json', 'WebFrame/vcpkg-configuration.json') }} |