Skip to content

Commit 1d085f6

Browse files
authored
Merge pull request #620 from 417-72KI/drop-swift-5.7
Drop Swift 5.7
2 parents d99c795 + 172603d commit 1d085f6

File tree

8 files changed

+153
-49
lines changed

8 files changed

+153
-49
lines changed

.github/workflows/ci.yml

Lines changed: 92 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,51 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15-
test-on-macos-12:
16-
name: Test on macOS 12
17-
runs-on: macOS-12
15+
test-on-macos-13:
16+
name: Test on macOS 13
17+
runs-on: macOS-13
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
xcode: ["13.2.1", "13.4.1", "14.1"]
21+
xcode: ["14.3.1"]
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- name: Cache dependencies
26+
uses: actions/cache@v2
27+
with:
28+
path: |
29+
.build/artifacts
30+
.build/checkouts
31+
.build/repositories
32+
key: ${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
33+
restore-keys: |
34+
${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
35+
${{ runner.os }}-dependencies-${{ matrix.xcode }}-
36+
37+
- name: Select Xcode
38+
run: |
39+
xcodebuild -version
40+
ls -nt /Applications/ | grep "Xcode*"
41+
sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app
42+
xcodebuild -version
43+
44+
- name: Install danger-js
45+
run: brew install danger/tap/danger-js
46+
47+
- run: swift test
48+
49+
- run: swift run danger-swift ci --verbose --failOnErrors
50+
if: ${{ github.event_name == 'pull_request' }}
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
test-on-macos-14:
54+
name: Test on macOS 14
55+
runs-on: macOS-14
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
xcode: ["15.2", "15.4"]
2260
steps:
2361
- uses: actions/checkout@v2
2462

@@ -53,11 +91,11 @@ jobs:
5391

5492
test-dependencies-resolver:
5593
name: Test dependencies resolver
56-
runs-on: macOS-12
94+
runs-on: macOS-14
5795
strategy:
5896
fail-fast: false
5997
matrix:
60-
xcode: ["13.2.1", "13.4.1", "14.1"]
98+
xcode: ["15.2", "15.4"]
6199
steps:
62100
- uses: actions/checkout@v2
63101

@@ -83,7 +121,7 @@ jobs:
83121
- name: Install danger-js
84122
run: brew install danger/tap/danger-js
85123

86-
- run: make install
124+
- run: make install PREFIX='/opt/homebrew'
87125

88126
- run: mkdir DangerTestWithDependencies && mv DangerfileWithDependencies.swift DangerTestWithDependencies/Dangerfile.swift
89127

@@ -94,11 +132,11 @@ jobs:
94132

95133
test-on-linux:
96134
name: Test on Linux
97-
runs-on: ubuntu-20.04
135+
runs-on: ubuntu-22.04
98136
strategy:
99137
fail-fast: false
100138
matrix:
101-
swift: ["5.5.3", "5.6.3", "5.7"]
139+
swift: ["5.8", "5.9", "5.10"]
102140
steps:
103141
- uses: actions/checkout@v2
104142
- uses: actions/setup-node@v2
@@ -131,13 +169,13 @@ jobs:
131169
env:
132170
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
133171

134-
test-without-spm-on-macos-12:
135-
name: Test without SPM on macOS 12
136-
runs-on: macOS-12
172+
test-without-spm-on-macos-13:
173+
name: Test without SPM on macOS 13
174+
runs-on: macOS-13
137175
strategy:
138176
fail-fast: false
139177
matrix:
140-
xcode: ["13.2.1", "13.4.1", "14.1"]
178+
xcode: ["14.3.1"]
141179
steps:
142180
- uses: actions/checkout@v2
143181

@@ -170,13 +208,52 @@ jobs:
170208
env:
171209
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
172210

211+
test-without-spm-on-macos-14:
212+
name: Test without SPM on macOS 14
213+
runs-on: macOS-14
214+
strategy:
215+
fail-fast: false
216+
matrix:
217+
xcode: ["15.2", "15.4"]
218+
steps:
219+
- uses: actions/checkout@v2
220+
221+
- name: Cache dependencies
222+
uses: actions/cache@v2
223+
with:
224+
path: |
225+
.build/artifacts
226+
.build/checkouts
227+
.build/repositories
228+
key: ${{ runner.os }}-without-spm-package-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
229+
restore-keys: |
230+
${{ runner.os }}-without-spm-package-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
231+
${{ runner.os }}-without-spm-package-${{ matrix.xcode }}-
232+
233+
- name: Select Xcode
234+
run: |
235+
xcodebuild -version
236+
ls -nt /Applications/ | grep "Xcode*"
237+
sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app
238+
xcodebuild -version
239+
240+
- name: Install danger-js
241+
run: brew install danger/tap/danger-js
242+
243+
- run: make install PREFIX='/opt/homebrew'
244+
245+
- run: danger-swift ci --verbose --failOnErrors
246+
if: ${{ github.event_name == 'pull_request' }}
247+
env:
248+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
249+
173250
test-without-spm-on-linux:
174251
name: Test without SPM on Linux
175-
runs-on: ubuntu-20.04
252+
runs-on: ubuntu-22.04
176253
strategy:
177254
fail-fast: false
178255
matrix:
179-
swift: ["5.5.3", "5.6.3", "5.7"]
256+
swift: ["5.8", "5.9", "5.10"]
180257
steps:
181258
- uses: actions/checkout@v2
182259
- uses: actions/setup-node@v2

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.5
1+
5.10

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
## Master
1515

16+
- Drop Swift 5.7 [@417-72KI][] - [#620](https://github.com/danger/swift/pull/620)
17+
- Fix pattern for detecting SwiftLint in package [@417-72KI][] - [#616](https://github.com/danger/swift/pull/616)
1618
- Allow optional GitLab MR description [@kvvzr][] - [#609](https://github.com/danger/swift/pull/609)
1719

1820
## 3.18.1

Package.resolved

Lines changed: 29 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.5
1+
// swift-tools-version:5.8
22

33
import PackageDescription
44

@@ -8,10 +8,10 @@ import PackageDescription
88
let isDevelop = true
99

1010
let swiftLint: Package.Dependency = {
11-
#if compiler(>=5.7)
12-
return .package(url: "https://github.com/Realm/SwiftLint", from: "0.51.0")
11+
#if compiler(>=5.9)
12+
return .package(url: "https://github.com/Realm/SwiftLint", from: "0.56.0")
1313
#else
14-
return .package(url: "https://github.com/Realm/SwiftLint", .exact("0.48.0"))
14+
return .package(url: "https://github.com/Realm/SwiftLint", exact: "0.53.0")
1515
#endif
1616
}()
1717

@@ -22,10 +22,10 @@ let devProducts: [Product] = isDevelop
2222
let devDependencies: [Package.Dependency] = isDevelop
2323
? [
2424
.package(url: "https://github.com/shibapm/Komondor", from: "1.1.4"),
25-
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.50.5"),
25+
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.54.0"),
2626
swiftLint,
27-
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.10.0"),
28-
.package(url: "https://github.com/shibapm/Rocket", from: "1.2.1"),
27+
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.17.0"),
28+
.package(url: "https://github.com/shibapm/Rocket", from: "1.3.0"),
2929
] : []
3030
let devTargets: [Target] = isDevelop
3131
? [
@@ -59,13 +59,20 @@ let package = Package(
5959
dependencies: [
6060
.package(url: "https://github.com/shibapm/Logger", from: "0.1.0"),
6161
.package(url: "https://github.com/mxcl/Version", from: "2.0.1"),
62-
.package(name: "OctoKit", url: "https://github.com/nerdishbynature/octokit.swift", from: "0.12.0"),
62+
.package(url: "https://github.com/nerdishbynature/octokit.swift", from: "0.13.0"),
6363
] + devDependencies,
6464
targets: [
6565
.target(name: "Danger-Swift", dependencies: ["Danger"]),
6666
.target(name: "DangerShellExecutor"),
6767
.target(name: "DangerDependenciesResolver", dependencies: ["DangerShellExecutor", "Version", "Logger"]),
68-
.target(name: "Danger", dependencies: ["OctoKit", "Logger", "DangerShellExecutor"]),
68+
.target(
69+
name: "Danger",
70+
dependencies: [
71+
.product(name: "OctoKit", package: "octokit.swift"),
72+
"Logger",
73+
"DangerShellExecutor"
74+
]
75+
),
6976
.target(name: "RunnerLib", dependencies: ["Logger", "DangerShellExecutor", "Version"]),
7077
.executableTarget(name: "Runner", dependencies: ["RunnerLib", "Logger", "DangerDependenciesResolver"]),
7178
.target(name: "DangerFixtures", dependencies: ["Danger"]),

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ Write your Dangerfiles in Swift.
77

88
### Requirements
99

10-
Latest version requires Swift 5.5
10+
Latest version requires Swift 5.8
1111

1212
If you are using an older Swift, use the supported version according to next table.
1313

1414
| Swift version | Danger support version |
1515
| ------------- | ---------------------- |
16+
| 5.5-5.7 | v3.18.1 |
1617
| 5.4 | v3.15.0 |
1718
| 5.3 | v3.13.0 |
1819
| 5.2 | v3.11.1 |

Scripts/create_homebrew_tap.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ echo " url \"https://github.com/danger/danger-swift/archive/#{version}.tar.gz\"
3030
echo " sha256 \"${SHA}\"" >> danger-swift.rb
3131
echo " head \"https://github.com/danger/danger-swift.git\"" >> danger-swift.rb
3232
echo >> danger-swift.rb
33-
echo " # Runs only on Xcode 12" >> danger-swift.rb
34-
echo " depends_on :xcode => [\"12\", :build]" >> danger-swift.rb
33+
echo " # Runs only on Xcode 14" >> danger-swift.rb
34+
echo " depends_on :xcode => [\"14\", :build]" >> danger-swift.rb
3535
echo " # Use the vendored danger" >> danger-swift.rb
3636
echo " depends_on \"danger/tap/danger-js\"" >> danger-swift.rb
3737
echo >> danger-swift.rb

Sources/DangerDependenciesResolver/InlineDependenciesFinder.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ struct InlineDependenciesFinder {
3232
.trimmingCharacters(in: .whitespaces)
3333
.components(separatedBy: " " + config.majorVersionPrefix)
3434

35-
guard let url = URL(string: splittedImportString[0]) else {
35+
let url: URL? = {
36+
#if os(macOS) && compiler(>=5.9)
37+
if #available(macOS 14.0, *) {
38+
return URL(string: splittedImportString[0], encodingInvalidCharacters: false)
39+
}
40+
#endif
41+
return URL(string: splittedImportString[0])
42+
}()
43+
guard let url = url else {
3644
throw Errors.invalidInlineDependencyURL(splittedImportString[0])
3745
}
3846

0 commit comments

Comments
 (0)