From ce0541893025c34908ca1018bcb0d64671b31b1a Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 22 Apr 2026 01:26:00 +0100 Subject: [PATCH] ci: preserve exact swift build cache --- .github/workflows/ci.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ea8126adf6..f5ee4f70145 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2188,9 +2188,24 @@ jobs: uses: actions/cache@v5 with: path: apps/macos/.build - key: ${{ runner.os }}-swift-build-v1-${{ steps.swift-toolchain.outputs.key }}-${{ hashFiles('apps/macos/Package.swift', 'apps/macos/Package.resolved', 'apps/shared/OpenClawKit/Package.swift', 'Swabble/Package.swift') }} + key: ${{ runner.os }}-swift-build-v2-${{ steps.swift-toolchain.outputs.key }}-${{ hashFiles('apps/macos/Package.swift', 'apps/macos/Package.resolved', 'apps/macos/Sources/**', 'apps/macos/Tests/**', 'apps/shared/OpenClawKit/Package.swift', 'apps/shared/OpenClawKit/Sources/**', 'Swabble/Package.swift', 'Swabble/Sources/**') }} restore-keys: | - ${{ runner.os }}-swift-build-v1-${{ steps.swift-toolchain.outputs.key }}- + ${{ runner.os }}-swift-build-v2-${{ steps.swift-toolchain.outputs.key }}- + + - name: Preserve exact Swift build cache hit + if: steps.swift-build-cache.outputs.cache-hit == 'true' + run: | + set -euo pipefail + # The cache key includes the Swift source/resource surface. On exact + # hits, checkout mtimes are the only reason SwiftPM rebuilds cached + # products, so normalize inputs older than restored build outputs. + find apps/macos/Sources apps/macos/Tests apps/shared/OpenClawKit/Sources Swabble/Sources \ + -type f -exec touch -t 200001010000 {} + + touch -t 200001010000 \ + apps/macos/Package.swift \ + apps/macos/Package.resolved \ + apps/shared/OpenClawKit/Package.swift \ + Swabble/Package.swift - name: Patch mlx-audio-swift manifest if: steps.swift-build-cache.outputs.cache-hit != 'true'