From 869b985052ff15cdb1d274a1e42787684f0f8bf1 Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Sat, 14 Dec 2024 18:46:50 -0500 Subject: [PATCH 1/6] CI and conditionally import CloudKit to support non-Darwin platforms --- .github/workflows/ci.yml | 45 +++++++++++++++++++ ...loudKitExchange+CKSyncEngineDelegate.swift | 3 ++ ...loudKitExchange+HandlingCloudChanges.swift | 4 +- Sources/ForkedCloudKit/CloudKitExchange.swift | 2 + 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..5b02c7fa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: Forked ci +on: + push: + branches: [ main ] + workflow_dispatch: + pull_request: + branches: + - '*' + schedule: + - cron: '0 4,16 * * *' +jobs: + linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: swift test + android: + # emulator fails to launch on ARM macOS with: HVF error: HV_UNSUPPORTED + # so we need to run on Intel macOS, which is macos-13 + runs-on: macos-13 + steps: + - uses: actions/checkout@v4 + - name: "Test Swift Package Android" + uses: skiptools/swift-android-action@v1 + with: + run-tests: false + macos-ios: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: "Test Swift Package macOS" + run: swift test + - name: "Test Swift Package iOS" + run: xcodebuild test -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 16" -scheme "Forked-Package" + windows: + runs-on: windows-latest + steps: + - uses: compnerd/gha-setup-swift@main + with: + branch: swift-5.9-release + tag: 5.9-RELEASE + - uses: actions/checkout@v4 + - run: swift build + - run: swift test + diff --git a/Sources/ForkedCloudKit/CloudKitExchange+CKSyncEngineDelegate.swift b/Sources/ForkedCloudKit/CloudKitExchange+CKSyncEngineDelegate.swift index 9267cd7f..e937f191 100644 --- a/Sources/ForkedCloudKit/CloudKitExchange+CKSyncEngineDelegate.swift +++ b/Sources/ForkedCloudKit/CloudKitExchange+CKSyncEngineDelegate.swift @@ -1,3 +1,4 @@ +#if canImport(CloudKit) import CloudKit import os.log @@ -71,3 +72,5 @@ extension CloudKitExchange: CKSyncEngineDelegate { } } +#endif + diff --git a/Sources/ForkedCloudKit/CloudKitExchange+HandlingCloudChanges.swift b/Sources/ForkedCloudKit/CloudKitExchange+HandlingCloudChanges.swift index f01834ef..98bf9ad4 100644 --- a/Sources/ForkedCloudKit/CloudKitExchange+HandlingCloudChanges.swift +++ b/Sources/ForkedCloudKit/CloudKitExchange+HandlingCloudChanges.swift @@ -1,3 +1,4 @@ +#if canImport(CloudKit) import CloudKit import Forked import os.log @@ -177,5 +178,4 @@ extension CloudKitExchange { } - - +#endif diff --git a/Sources/ForkedCloudKit/CloudKitExchange.swift b/Sources/ForkedCloudKit/CloudKitExchange.swift index b07537f8..fcce8b71 100644 --- a/Sources/ForkedCloudKit/CloudKitExchange.swift +++ b/Sources/ForkedCloudKit/CloudKitExchange.swift @@ -1,3 +1,4 @@ +#if canImport(CloudKit) import CloudKit import SwiftUI import AsyncAlgorithms @@ -215,4 +216,5 @@ internal extension CloudKitExchange { } } +#endif From ec4ee62fa65fb6eeeafd9145d372995b5baedba1 Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Mon, 16 Dec 2024 23:28:29 +0800 Subject: [PATCH 2/6] CI Update --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b02c7fa..813a09dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,8 +6,8 @@ on: pull_request: branches: - '*' - schedule: - - cron: '0 4,16 * * *' + #schedule: + # - cron: '0 4,16 * * *' jobs: linux: runs-on: ubuntu-latest @@ -25,7 +25,7 @@ jobs: with: run-tests: false macos-ios: - runs-on: macos-latest + runs-on: macos-15 steps: - uses: actions/checkout@v4 - name: "Test Swift Package macOS" From 70ed5d5c87605a1f72dde736c953d59ad069f4f9 Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Fri, 10 Jan 2025 10:12:20 -0500 Subject: [PATCH 3/6] Update CI --- .github/workflows/ci.yml | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 813a09dc..84a6dacb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,45 +1,35 @@ name: Forked ci on: push: - branches: [ main ] workflow_dispatch: pull_request: - branches: - - '*' - #schedule: - # - cron: '0 4,16 * * *' jobs: - linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: swift test - android: - # emulator fails to launch on ARM macOS with: HVF error: HV_UNSUPPORTED - # so we need to run on Intel macOS, which is macos-13 - runs-on: macos-13 - steps: - - uses: actions/checkout@v4 - - name: "Test Swift Package Android" - uses: skiptools/swift-android-action@v1 - with: - run-tests: false macos-ios: - runs-on: macos-15 + runs-on: macos-latest steps: - uses: actions/checkout@v4 - name: "Test Swift Package macOS" run: swift test - name: "Test Swift Package iOS" run: xcodebuild test -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 16" -scheme "Forked-Package" + linux-android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: "Test Swift Package on Linux" + run: swift test + - name: "Test Swift Package on Android" + uses: skiptools/swift-android-action@v2 + with: + run-tests: false windows: runs-on: windows-latest steps: - uses: compnerd/gha-setup-swift@main with: - branch: swift-5.9-release - tag: 5.9-RELEASE + branch: swift-6.0.3-release + tag: 6.0.3-RELEASE - uses: actions/checkout@v4 - - run: swift build - - run: swift test + - name: "Test Swift Package on Windows" + run: swift test From 4db634e94921c63f4b49566a4464d5d4842ccdae Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Fri, 10 Jan 2025 10:25:01 -0500 Subject: [PATCH 4/6] CI updates --- .github/workflows/ci.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84a6dacb..cf15b1f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,25 +5,28 @@ on: pull_request: jobs: macos-ios: - runs-on: macos-latest + runs-on: macos-15 steps: - uses: actions/checkout@v4 - - name: "Test Swift Package macOS" + - name: "Test Swift Package on macOS" run: swift test - - name: "Test Swift Package iOS" + - name: "Test Swift Package on iOS" run: xcodebuild test -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 16" -scheme "Forked-Package" linux-android: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - name: "Test Swift Package on Linux" run: swift test - - name: "Test Swift Package on Android" + - name: "Build Swift Package on Android" uses: skiptools/swift-android-action@v2 with: - run-tests: false + # Android SDK does not yet support Testing framework + build-tests: false windows: runs-on: windows-latest + # Error: error: invalid path 'docs/Forked/data/documentation/forked/atomicrepository/content(of:at:).json' + if: false steps: - uses: compnerd/gha-setup-swift@main with: From 7630ede834bb737de5b5453f7bf741fbb1d38be3 Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Fri, 10 Jan 2025 10:32:55 -0500 Subject: [PATCH 5/6] CI updates --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf15b1f4..dbe13c14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: - name: "Test Swift Package on macOS" run: swift test - name: "Test Swift Package on iOS" - run: xcodebuild test -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 16" -scheme "Forked-Package" + run: xcodebuild test -skipMacroValidation -skipPackagePluginValidation -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 16" -scheme "Forked-Package" linux-android: runs-on: ubuntu-24.04 steps: From 822df8693ce305545cb7d87ccbba8cb87f9f70e4 Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Fri, 10 Jan 2025 10:39:38 -0500 Subject: [PATCH 6/6] CI updates --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbe13c14..e63a0e32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,8 +10,9 @@ jobs: - uses: actions/checkout@v4 - name: "Test Swift Package on macOS" run: swift test - - name: "Test Swift Package on iOS" - run: xcodebuild test -skipMacroValidation -skipPackagePluginValidation -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 16" -scheme "Forked-Package" + - name: "Build Swift Package on iOS" + run: xcodebuild build -skipMacroValidation -skipPackagePluginValidation -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 16" -scheme "Forked-Package" + #run: xcodebuild test -skipMacroValidation -skipPackagePluginValidation -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 16" -scheme "Forked-Package" linux-android: runs-on: ubuntu-24.04 steps: