Skip to content

Commit 2b8695d

Browse files
committed
Fix CI for Xcode 26 and older Swift compilers
1 parent bdb17c0 commit 2b8695d

3 files changed

Lines changed: 65 additions & 33 deletions

File tree

.github/workflows/swift.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ permissions:
1414
contents: read
1515

1616
jobs:
17-
xcode-16-3:
18-
runs-on: macos-15
17+
xcode-26:
18+
runs-on: macos-26
1919
env:
20-
DEVELOPER_DIR: /Applications/Xcode_16.3.app/Contents/Developer
20+
DEVELOPER_DIR: /Applications/Xcode_26.4.1.app/Contents/Developer
2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v5
2323
- name: Version
2424
run: swift --version
2525
- name: Build
@@ -39,12 +39,25 @@ jobs:
3939
fail_ci_if_error: false
4040
verbose: true
4141

42+
xcode-16-3:
43+
runs-on: macos-15
44+
env:
45+
DEVELOPER_DIR: /Applications/Xcode_16.3.app/Contents/Developer
46+
steps:
47+
- uses: actions/checkout@v5
48+
- name: Version
49+
run: swift --version
50+
- name: Build
51+
run: swift build -v
52+
- name: Test
53+
run: swift test -v
54+
4255
xcode-15-4:
4356
runs-on: macos-14
4457
env:
4558
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
4659
steps:
47-
- uses: actions/checkout@v4
60+
- uses: actions/checkout@v5
4861
- name: Version
4962
run: swift --version
5063
- name: Build
@@ -53,11 +66,11 @@ jobs:
5366
# run: swift test -v
5467

5568
xcode-15-0:
56-
runs-on: macos-13
69+
runs-on: macos-14
5770
env:
5871
DEVELOPER_DIR: /Applications/Xcode_15.0.app/Contents/Developer
5972
steps:
60-
- uses: actions/checkout@v4
73+
- uses: actions/checkout@v5
6174
- name: Version
6275
run: swift --version
6376
- name: Build

.github/workflows/validate-json.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515

1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v5
1919

20-
- name: Setup Node.js
21-
uses: actions/setup-node@v4
20+
- name: Setup Bun
21+
uses: oven-sh/setup-bun@v2
2222
with:
23-
node-version: '18'
23+
bun-version: latest
2424

2525
- name: Install dependencies
26-
run: npm install -g ajv-cli ajv-formats
26+
run: bun add --global ajv-cli ajv-formats
2727

2828
- name: Create JSON schema for validation
2929
run: |
@@ -116,7 +116,7 @@ jobs:
116116
echo "Validating schema for language: $LANG_DIR - $FILE"
117117
118118
# Validate against schema
119-
if ! npx ajv -s schema.json -d "$FILE" --strict=false; then
119+
if ! bunx ajv -s schema.json -d "$FILE" --strict=false; then
120120
echo "❌ $LANG_DIR ($FILE) does not match the required schema"
121121
ERROR=1
122122
else
@@ -137,7 +137,7 @@ jobs:
137137

138138
steps:
139139
- name: Checkout repository
140-
uses: actions/checkout@v4
140+
uses: actions/checkout@v5
141141

142142
- name: Find JSON files
143143
id: find-json
@@ -240,4 +240,4 @@ jobs:
240240
uses: actions/upload-artifact@v4
241241
with:
242242
name: localization-report
243-
path: localization_report.md
243+
path: localization_report.md

Sources/SwiftNEW/Styles/MeshView.swift

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,46 @@ import SwiftUI
99

1010
struct MeshView: View {
1111
@Binding var color: Color
12+
1213
var body: some View {
14+
#if compiler(>=6.0)
1315
if #available(iOS 18.0, macOS 15.0, visionOS 2.0, tvOS 18.0, *) {
14-
// Diagonal flow: clear at top-left → most opaque at bottom-right.
15-
MeshGradient(width: 3, height: 3, points: [
16-
.init(0, 0), .init(0.5, 0), .init(1, 0),
17-
.init(0, 0.5), .init(0.5, 0.5), .init(1, 0.5),
18-
.init(0, 1), .init(0.5, 1), .init(1, 1)
19-
], colors: [
20-
Color(.clear), Color(.clear), Color(.clear),
21-
color.opacity(0.1), color.opacity(0.1), color.opacity(0.2),
22-
color.opacity(0.5), color.opacity(0.6), color.opacity(0.7)
23-
])
24-
.ignoresSafeArea(.all)
25-
.overlay(
26-
NoiseView(size: 5000)
27-
.drawingGroup()
28-
)
16+
meshGradient
2917
} else {
30-
// Fallback on earlier versions
31-
LinearGradient(colors: [Color(.clear), color.opacity(0.6)], startPoint: .topLeading, endPoint: .bottomTrailing)
32-
.ignoresSafeArea(.all)
18+
fallbackGradient
3319
}
20+
#else
21+
fallbackGradient
22+
#endif
23+
}
24+
25+
#if compiler(>=6.0)
26+
@available(iOS 18.0, macOS 15.0, visionOS 2.0, tvOS 18.0, *)
27+
private var meshGradient: some View {
28+
// Diagonal flow: clear at top-left to most opaque at bottom-right.
29+
MeshGradient(width: 3, height: 3, points: [
30+
.init(0, 0), .init(0.5, 0), .init(1, 0),
31+
.init(0, 0.5), .init(0.5, 0.5), .init(1, 0.5),
32+
.init(0, 1), .init(0.5, 1), .init(1, 1)
33+
], colors: [
34+
Color(.clear), Color(.clear), Color(.clear),
35+
color.opacity(0.1), color.opacity(0.1), color.opacity(0.2),
36+
color.opacity(0.5), color.opacity(0.6), color.opacity(0.7)
37+
])
38+
.ignoresSafeArea(.all)
39+
.overlay(
40+
NoiseView(size: 5000)
41+
.drawingGroup()
42+
)
43+
}
44+
#endif
45+
46+
private var fallbackGradient: some View {
47+
LinearGradient(
48+
colors: [Color(.clear), color.opacity(0.6)],
49+
startPoint: .topLeading,
50+
endPoint: .bottomTrailing
51+
)
52+
.ignoresSafeArea(.all)
3453
}
3554
}

0 commit comments

Comments
 (0)