mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-09 15:59:30 +00:00
fix(ci): recover incomplete Swift build caches (#98818)
This commit is contained in:
parent
db6a3c2e87
commit
c1eee1a41a
1 changed files with 16 additions and 3 deletions
19
.github/workflows/ci.yml
vendored
19
.github/workflows/ci.yml
vendored
|
|
@ -1732,12 +1732,25 @@ jobs:
|
|||
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
|
||||
with:
|
||||
path: apps/macos/.build
|
||||
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/**') }}
|
||||
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/**') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-swift-build-v2-${{ steps.swift-toolchain.outputs.key }}-
|
||||
${{ runner.os }}-swift-build-v3-${{ steps.swift-toolchain.outputs.key }}-
|
||||
|
||||
- name: Validate Swift build cache
|
||||
id: validate-swift-build-cache
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cache_valid=true
|
||||
sparkle_info="apps/macos/.build/artifacts/sparkle/Sparkle/Sparkle.xcframework/Info.plist"
|
||||
if [[ -d apps/macos/.build && ! -f "$sparkle_info" ]]; then
|
||||
echo "::warning::Swift build cache is missing Sparkle; resetting the local SwiftPM build directory."
|
||||
swift package --package-path apps/macos reset
|
||||
cache_valid=false
|
||||
fi
|
||||
echo "cache-valid=$cache_valid" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Preserve Swift build cache hit
|
||||
if: steps.swift-build-cache.outputs.cache-hit == 'true'
|
||||
if: steps.swift-build-cache.outputs.cache-hit == 'true' && steps.validate-swift-build-cache.outputs.cache-valid == 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# Exact source-hash cache hits already match these inputs; checkout
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue