diff --git a/.github/workflows/ResInsightMac.yml b/.github/workflows/ResInsightMac.yml index 165dbb97e0..4a1f7b3c05 100644 --- a/.github/workflows/ResInsightMac.yml +++ b/.github/workflows/ResInsightMac.yml @@ -166,16 +166,17 @@ jobs: - name: Restore vcpkg cache id: vcpkg-cache - uses: CeetronSolutions/vcpkg-cache@copilot/optimize-cache-storage-structure + # Restore only; saved after a successful Configure so partial caches are never written. + uses: actions/cache/restore@v6 with: - cache-key: ${{ runner.os }}-${{ matrix.arch }}-clang-${{ steps.vcpkg-sha.outputs.sha }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} - prefix: vcpkg-clang/ + path: ${{ github.workspace }}/.vcpkg-cache + key: vcpkg-${{ runner.os }}-${{ matrix.arch }}-clang-${{ steps.vcpkg-sha.outputs.sha }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} - name: Configure shell: bash env: VCPKG_FEATURE_FLAGS: "binarycaching" - VCPKG_BINARY_SOURCES: "clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite" + VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/.vcpkg-cache,readwrite" run: > cmake -S . -B cmakebuild -DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-osx-release @@ -195,6 +196,13 @@ jobs: -DCMAKE_TOOLCHAIN_FILE=ThirdParty/vcpkg/scripts/buildsystems/vcpkg.cmake -G Ninja + - name: Save vcpkg cache + if: success() && steps.vcpkg-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: ${{ github.workspace }}/.vcpkg-cache + key: ${{ steps.vcpkg-cache.outputs.cache-primary-key }} + - name: Build run: | cmake --build cmakebuild --target install diff --git a/.github/workflows/ResInsightWithCache.yml b/.github/workflows/ResInsightWithCache.yml index ba78c05e94..7627fe44c8 100644 --- a/.github/workflows/ResInsightWithCache.yml +++ b/.github/workflows/ResInsightWithCache.yml @@ -258,11 +258,14 @@ jobs: - name: Restore vcpkg cache id: vcpkg-cache - uses: CeetronSolutions/vcpkg-cache@copilot/optimize-cache-storage-structure + # Restore only. The cache is saved by the "Save vcpkg cache" step after a + # successful Configure, so failed or cancelled jobs never write partial + # caches. + uses: actions/cache/restore@v6 with: - cache-key: ${{ runner.os }}-${{ matrix.config.cxx }}-${{ steps.image-version.outputs.version }}-${{ steps.compiler-hash.outputs.hash }}-${{ matrix.config.vcpkg-triplet }}-${{ steps.vcpkg-sha.outputs.sha }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} - prefix: vcpkg-${{ matrix.config.cxx}}/ - + path: ${{ github.workspace }}/.vcpkg-cache + key: vcpkg-${{ runner.os }}-${{ matrix.config.cxx }}-${{ steps.image-version.outputs.version }}-${{ steps.compiler-hash.outputs.hash }}-${{ matrix.config.vcpkg-triplet }}-${{ steps.vcpkg-sha.outputs.sha }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} + - name: Print CMake version shell: bash run: | @@ -278,7 +281,7 @@ jobs: shell: bash env: VCPKG_FEATURE_FLAGS: "binarycaching" # Possibly redundant, but explicitly sets the binary caching feature flag - VCPKG_BINARY_SOURCES: "clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite" + VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/.vcpkg-cache,readwrite" CC: ${{ matrix.config.cc }} CXX: ${{ matrix.config.cxx }} run: > @@ -299,6 +302,14 @@ jobs: -DCMAKE_TOOLCHAIN_FILE=ThirdParty/vcpkg/scripts/buildsystems/vcpkg.cmake -G Ninja + - name: Save vcpkg cache + # Only after a fully successful Configure (all ports built) + if: success() && steps.vcpkg-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: ${{ github.workspace }}/.vcpkg-cache + key: ${{ steps.vcpkg-cache.outputs.cache-primary-key }} + - name: Build run: | cmake --build cmakebuild --target install diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 0b863613e2..5e85fd1fa9 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -48,15 +48,17 @@ jobs: - name: Restore vcpkg cache id: vcpkg-cache - uses: CeetronSolutions/vcpkg-cache@copilot/optimize-cache-storage-structure + # Restore only; saved after a successful configure so partial caches are never written. + uses: actions/cache/restore@v6 with: - cache-key: ${{ runner.os }}-clang-tidy-19-${{ steps.vcpkg-sha.outputs.sha }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} + path: ${{ github.workspace }}/.vcpkg-cache + key: vcpkg-${{ runner.os }}-clang-tidy-19-${{ steps.vcpkg-sha.outputs.sha }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} - name: Create compile commands and run clang-tidy # https://clang.llvm.org/extra/doxygen/run-clang-tidy_8py_source.html env: VCPKG_FEATURE_FLAGS: "binarycaching" # Possibly redundant, but explicitly sets the binary caching feature flag - VCPKG_BINARY_SOURCES: "clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite" + VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/.vcpkg-cache,readwrite" run: | mkdir build cd build @@ -70,6 +72,12 @@ jobs: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_TOOLCHAIN_FILE=ThirdParty/vcpkg/scripts/buildsystems/vcpkg.cmake \ .. + - name: Save vcpkg cache + if: success() && steps.vcpkg-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: ${{ github.workspace }}/.vcpkg-cache + key: ${{ steps.vcpkg-cache.outputs.cache-primary-key }} - name: Run clang-tidy and apply fixes continue-on-error: true run: | diff --git a/.github/workflows/clazy-report.yml b/.github/workflows/clazy-report.yml index 4391af0973..1ebda20777 100644 --- a/.github/workflows/clazy-report.yml +++ b/.github/workflows/clazy-report.yml @@ -56,14 +56,16 @@ jobs: - name: Restore vcpkg cache id: vcpkg-cache - uses: CeetronSolutions/vcpkg-cache@copilot/optimize-cache-storage-structure + # Restore only; saved after a successful configure so partial caches are never written. + uses: actions/cache/restore@v6 with: - cache-key: ${{ runner.os }}-clang-tidy-19-${{ steps.vcpkg-sha.outputs.sha }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} + path: ${{ github.workspace }}/.vcpkg-cache + key: vcpkg-${{ runner.os }}-clang-tidy-19-${{ steps.vcpkg-sha.outputs.sha }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }} - name: Create compile commands env: VCPKG_FEATURE_FLAGS: "binarycaching" # Possibly redundant, but explicitly sets the binary caching feature flag - VCPKG_BINARY_SOURCES: "clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite" + VCPKG_BINARY_SOURCES: "clear;files,${{ github.workspace }}/.vcpkg-cache,readwrite" run: | mkdir build cd build @@ -77,6 +79,12 @@ jobs: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_TOOLCHAIN_FILE=ThirdParty/vcpkg/scripts/buildsystems/vcpkg.cmake \ .. + - name: Save vcpkg cache + if: success() && steps.vcpkg-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: ${{ github.workspace }}/.vcpkg-cache + key: ${{ steps.vcpkg-cache.outputs.cache-primary-key }} - name: Run clazy (Qt checks, report only) continue-on-error: true run: |