Skip to content

Commit 5aa71cc

Browse files
committed
fix(ci): recover incomplete Swift build caches
1 parent 1cbcff7 commit 5aa71cc

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,12 +1732,25 @@ jobs:
17321732
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
17331733
with:
17341734
path: apps/macos/.build
1735-
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/**', 'apps/swabble/Package.swift', 'apps/swabble/Sources/**') }}
1735+
key: ${{ runner.os }}-swift-build-v3-${{ 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/**', 'apps/swabble/Package.swift', 'apps/swabble/Sources/**') }}
17361736
restore-keys: |
1737-
${{ runner.os }}-swift-build-v2-${{ steps.swift-toolchain.outputs.key }}-
1737+
${{ runner.os }}-swift-build-v3-${{ steps.swift-toolchain.outputs.key }}-
1738+
1739+
- name: Validate Swift build cache
1740+
id: validate-swift-build-cache
1741+
run: |
1742+
set -euo pipefail
1743+
cache_valid=true
1744+
sparkle_info="apps/macos/.build/artifacts/sparkle/Sparkle/Sparkle.xcframework/Info.plist"
1745+
if [[ -d apps/macos/.build && ! -f "$sparkle_info" ]]; then
1746+
echo "::warning::Swift build cache is missing Sparkle; resetting the local SwiftPM build directory."
1747+
swift package --package-path apps/macos reset
1748+
cache_valid=false
1749+
fi
1750+
echo "cache-valid=$cache_valid" >> "$GITHUB_OUTPUT"
17381751
17391752
- name: Preserve Swift build cache hit
1740-
if: steps.swift-build-cache.outputs.cache-hit == 'true'
1753+
if: steps.swift-build-cache.outputs.cache-hit == 'true' && steps.validate-swift-build-cache.outputs.cache-valid == 'true'
17411754
run: |
17421755
set -euo pipefail
17431756
# Exact source-hash cache hits already match these inputs; checkout

0 commit comments

Comments
 (0)