Skip to content

Commit e1c1c5a

Browse files
leogdionclaude
andcommitted
feat(infra): add dependency management and update CI workflows
- Add Scripts/toggle-dependencies.sh for local/remote dependency switching - Add Scripts/ensure-remote-deps.sh to each subrepo for CI safety - Add Scripts/lint-all.sh for monorepo-wide linting - Update all subrepo workflows to ensure remote dependencies before build - Remove pre-Swift 6.1 versions from SundialKitBinary and SundialKitStream matrices - Run linting and apply formatting fixes across all subrepos 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0962254 commit e1c1c5a

File tree

5 files changed

+76
-35
lines changed

5 files changed

+76
-35
lines changed

.github/workflows/SundialKitBinary.yml

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,16 @@ jobs:
1616
matrix:
1717
os: [noble, jammy]
1818
swift:
19-
- version: "5.9"
20-
- version: "5.10"
21-
- version: "6.0"
2219
- version: "6.1"
2320
- version: "6.2"
2421
- version: "6.1"
2522
nightly: true
2623
- version: "6.2"
2724
nightly: true
28-
exclude:
29-
- os: noble
30-
swift:
31-
version: "5.9"
3225
steps:
3326
- uses: actions/checkout@v4
27+
- name: Ensure remote dependencies
28+
run: ./Scripts/ensure-remote-deps.sh
3429
- uses: brightdigit/swift-build@v1.3.4
3530
with:
3631
scheme: ${{ env.PACKAGE_NAME }}
@@ -54,30 +49,15 @@ jobs:
5449
fail-fast: false
5550
matrix:
5651
include:
57-
# SPM Build Matrix - Xcode 15.x (Swift 5.9-5.10)
58-
- runs-on: macos-14
59-
xcode: "/Applications/Xcode_15.0.1.app"
60-
- runs-on: macos-14
61-
xcode: "/Applications/Xcode_15.2.app"
62-
- runs-on: macos-14
63-
xcode: "/Applications/Xcode_15.4.app"
64-
65-
# SPM Build Matrix - Xcode 16.x+ (Swift 6.x)
52+
# SPM Build Matrix - Xcode 16.x+ (Swift 6.1+)
6653
- runs-on: macos-15
6754
xcode: "/Applications/Xcode_26.0.app"
6855
- runs-on: macos-15
6956
xcode: "/Applications/Xcode_16.4.app"
7057
- runs-on: macos-15
7158
xcode: "/Applications/Xcode_16.3.app"
7259

73-
# iOS Build Matrix - Xcode 15.x (Swift 5.9-5.10)
74-
- type: ios
75-
runs-on: macos-14
76-
xcode: "/Applications/Xcode_15.4.app"
77-
deviceName: "iPhone 15"
78-
osVersion: "17.5"
79-
80-
# iOS Build Matrix - Xcode 16.x+ (Swift 6.x)
60+
# iOS Build Matrix - Xcode 16.x+ (Swift 6.1+)
8161
- type: ios
8262
runs-on: macos-15
8363
xcode: "/Applications/Xcode_26.0.app"
@@ -97,14 +77,7 @@ jobs:
9777
deviceName: "iPhone 16"
9878
osVersion: "18.4"
9979

100-
# watchOS Build Matrix - Xcode 15.x (Swift 5.9-5.10)
101-
- type: watchos
102-
runs-on: macos-14
103-
xcode: "/Applications/Xcode_15.4.app"
104-
deviceName: "Apple Watch Series 9 (45mm)"
105-
osVersion: "10.5"
106-
107-
# watchOS Build Matrix - Xcode 16.x+ (Swift 6.x)
80+
# watchOS Build Matrix - Xcode 16.x+ (Swift 6.1+)
10881
- type: watchos
10982
runs-on: macos-15
11083
xcode: "/Applications/Xcode_26.0.app"
@@ -127,6 +100,9 @@ jobs:
127100
steps:
128101
- uses: actions/checkout@v4
129102

103+
- name: Ensure remote dependencies
104+
run: ./Scripts/ensure-remote-deps.sh
105+
130106
- name: Build and Test
131107
uses: brightdigit/swift-build@v1.3.4
132108
with:

Package.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ let package = Package(
5757
)
5858
],
5959
dependencies: [
60-
// TODO: Add SundialKit dependency
61-
// .package(url: "https://github.com/brightdigit/SundialKit.git", from: "2.0.0")
60+
.package(path: "../../")
6261
],
6362
targets: [
6463
.target(
6564
name: "SundialKitBinary",
66-
dependencies: [],
65+
dependencies: [
66+
.product(name: "SundialKit", package: "SundialKit")
67+
],
6768
swiftSettings: swiftSettings
6869
),
6970
.testTarget(

Scripts/ensure-remote-deps.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
# Ensure Package.swift uses remote SundialKit dependency
3+
# Used in CI to guarantee remote URLs are configured
4+
5+
set -euo pipefail
6+
7+
REMOTE_URL="https://github.com/brightdigit/SundialKit.git"
8+
REMOTE_BRANCH="branch: \"v2.0.0\""
9+
LOCAL_PATH="../../"
10+
11+
PACKAGE_FILE="Package.swift"
12+
13+
if [[ ! -f "$PACKAGE_FILE" ]]; then
14+
echo "❌ Package.swift not found"
15+
exit 1
16+
fi
17+
18+
# Check if already using remote URL
19+
if grep -q "\.package(url: \"$REMOTE_URL\"" "$PACKAGE_FILE"; then
20+
echo "✅ Already using remote dependency"
21+
exit 0
22+
fi
23+
24+
# Switch from local to remote
25+
if grep -q "\.package(path:" "$PACKAGE_FILE"; then
26+
echo "🔄 Switching to remote dependency..."
27+
sed -i '' \
28+
-e 's|\.package(path: "'"$LOCAL_PATH"'")|.package(url: "'"$REMOTE_URL"'", '"$REMOTE_BRANCH"')|g' \
29+
"$PACKAGE_FILE"
30+
echo "✅ Switched to remote dependency"
31+
else
32+
echo "⚠️ Unknown dependency format in Package.swift"
33+
exit 1
34+
fi

Sources/SundialKitBinary/SundialKitBinary.swift

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
//
2+
// SundialKitBinary.swift
3+
// SundialKitBinary
4+
//
5+
// Created by Leo Dion.
6+
// Copyright © 2025 BrightDigit.
7+
//
8+
// Permission is hereby granted, free of charge, to any person
9+
// obtaining a copy of this software and associated documentation
10+
// files (the "Software"), to deal in the Software without
11+
// restriction, including without limitation the rights to use,
12+
// copy, modify, merge, publish, distribute, sublicense, and/or
13+
// sell copies of the Software, and to permit persons to whom the
14+
// Software is furnished to do so, subject to the following
15+
// conditions:
16+
//
17+
// The above copyright notice and this permission notice shall be
18+
// included in all copies or substantial portions of the Software.
19+
//
20+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25+
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27+
// OTHER DEALINGS IN THE SOFTWARE.
28+
//
29+
130
/// SundialKitBinary provides modern binary serialization support for SundialKit.
231
///
332
/// This package extends SundialKit with efficient binary encoding and decoding

Tests/SundialKitBinaryTests/SundialKitBinaryTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Testing
2+
23
@testable import SundialKitBinary
34

45
@Suite("SundialKitBinary Tests")

0 commit comments

Comments
 (0)