Skip to content

Commit 5c3b848

Browse files
Merge pull request #12 from roboflow/feat/actions
Update workflow
2 parents 160b941 + ad952f8 commit 5c3b848

File tree

2 files changed

+55
-11
lines changed

2 files changed

+55
-11
lines changed

.github/workflows/swift.yml

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# This workflow will build a Swift project
1+
# This workflow will build and test a Swift project
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
33

4-
name: Swift
4+
name: Swift Build and Test
55

66
on:
77
push:
@@ -11,13 +11,57 @@ on:
1111
workflow_dispatch:
1212

1313
jobs:
14-
build:
15-
16-
runs-on: macos-latest
14+
build-and-test:
15+
name: Build and Test Swift Package
16+
runs-on: macos-15
1717

1818
steps:
19-
- uses: actions/checkout@v4
20-
- name: Build
21-
run: swift build -v
22-
- name: Run tests
23-
run: swift test -v
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Xcode
23+
uses: maxim-lobanov/setup-xcode@v1.6.0
24+
with:
25+
xcode-version: '16.0' # Required for iOS 18.0+ and macOS 15.0+
26+
27+
- name: Setup Swift environment
28+
uses: swift-actions/setup-swift@v2.3.0
29+
with:
30+
swift-version: '6.0' # Use Swift 6.0 for better iOS 18 support
31+
32+
- name: Verify build environment
33+
run: |
34+
echo "Xcode version:"
35+
xcodebuild -version
36+
echo "Swift version:"
37+
swift --version
38+
echo "Available SDKs:"
39+
xcodebuild -showsdks
40+
echo "Core ML availability test:"
41+
swift -e 'import CoreML; print("Core ML framework is available")' || {
42+
echo "Warning: Basic Core ML framework not found"
43+
}
44+
45+
- name: Cache Swift Package Manager dependencies
46+
uses: actions/cache@v4
47+
with:
48+
path: |
49+
~/.cache/org.swift.swiftpm
50+
.build
51+
key: ${{ runner.os }}-swift-${{ hashFiles('**/Package.swift') }}
52+
restore-keys: |
53+
${{ runner.os }}-swift-
54+
55+
- name: Resolve Swift Package Manager dependencies
56+
run: swift package resolve
57+
58+
- name: Build Swift package
59+
run:
60+
swift build
61+
62+
- name: Run Swift package tests
63+
run: |
64+
swift test
65+
66+
- name: Validate package structure
67+
run: swift package describe

Sources/Roboflow/Classes/Utils/RoboflowErrors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public struct UnsupportedOSError: Error, LocalizedError, CustomStringConvertible
1111

1212
// MARK: Initialiser
1313
public init(
14-
message: String = "This feature is not available on the current operating system.",
14+
message: String = "This feature is not available on the current operating system."
1515
) {
1616
self.message = message
1717
}

0 commit comments

Comments
 (0)