Skip to content

Commit cbd9be0

Browse files
committed
attempt to fix worklow
1 parent 5fb5380 commit cbd9be0

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,24 @@ jobs:
1515
- name: Checkout
1616
uses: actions/checkout@v4
1717

18-
- name: Setup Swift
18+
- name: Setup Xcode
19+
uses: maxim-lobanov/setup-xcode@v1
20+
with:
21+
xcode-version: 'latest'
22+
23+
- name: Verify Swift Version
1924
run: |
2025
swift --version
26+
SWIFT_VERSION=$(swift --version | grep -oE 'Swift version [0-9]+\.[0-9]+' | grep -oE '[0-9]+\.[0-9]+')
27+
echo "Detected Swift version: $SWIFT_VERSION"
28+
MAJOR=$(echo $SWIFT_VERSION | cut -d. -f1)
29+
MINOR=$(echo $SWIFT_VERSION | cut -d. -f2)
30+
if [ "$MAJOR" -lt 6 ] || ([ "$MAJOR" -eq 6 ] && [ "$MINOR" -lt 2 ]); then
31+
echo "Error: Swift 6.2 or later is required, but found $SWIFT_VERSION"
32+
echo "Please update the Xcode version in the workflow or wait for GitHub Actions to provide Swift 6.2"
33+
exit 1
34+
fi
35+
echo "✓ Swift version $SWIFT_VERSION meets requirement (>= 6.2)"
2136
2237
- name: Resolve Dependencies
2338
run: swift package resolve
@@ -41,6 +56,11 @@ jobs:
4156
- name: Checkout
4257
uses: actions/checkout@v4
4358

59+
- name: Setup Xcode
60+
uses: maxim-lobanov/setup-xcode@v1
61+
with:
62+
xcode-version: 'latest'
63+
4464
- name: Run SwiftLint
4565
uses: norio-nomura/action-swiftlint@3.2.1
4666
continue-on-error: true
@@ -54,6 +74,11 @@ jobs:
5474
- name: Checkout
5575
uses: actions/checkout@v4
5676

77+
- name: Setup Xcode
78+
uses: maxim-lobanov/setup-xcode@v1
79+
with:
80+
xcode-version: 'latest'
81+
5782
- name: Run Tests with Coverage
5883
run: swift test --enable-code-coverage
5984
env:

0 commit comments

Comments
 (0)