Skip to content

Commit efa8cbe

Browse files
Copilotmxcl
andcommitted
Merge latest master (117d402) into PR - use master's CI configuration
Co-authored-by: mxcl <58962+mxcl@users.noreply.github.com>
1 parent be3f1c5 commit efa8cbe

3 files changed

Lines changed: 54 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
name: CI
22
on:
33
pull_request:
4+
<<<<<<< HEAD
45
schedule:
56
- cron: '3 3 * * 5' # 3:03 AM, every Friday
7+
=======
8+
>>>>>>> origin/master
69

710
concurrency:
811
group: ${{ github.head_ref || 'push' }}
912
cancel-in-progress: true
1013

1114
jobs:
15+
<<<<<<< HEAD
1216
verify-linuxmain:
1317
runs-on: macos-13
1418
steps:
@@ -18,6 +22,12 @@ jobs:
1822

1923
apple:
2024
runs-on: macos-13
25+
=======
26+
# we want to test more macOS versions but GitHub make that difficult without
27+
# constant maintenance because runners are deprecated and removed
28+
apple:
29+
runs-on: macos-latest
30+
>>>>>>> origin/master
2131
strategy:
2232
matrix:
2333
platform:
@@ -26,16 +36,21 @@ jobs:
2636
- macOS
2737
- watchOS
2838
steps:
39+
<<<<<<< HEAD
2940
- uses: actions/checkout@v4
3041
- uses: mxcl/xcodebuild@v1
42+
=======
43+
- uses: actions/checkout@v6
44+
- uses: mxcl/xcodebuild@latest
45+
>>>>>>> origin/master
3146
with:
3247
platform: ${{ matrix.platform }}
3348
code-coverage: true
34-
warnings-as-errors: true
35-
- uses: codecov/codecov-action@v1
49+
- uses: codecov/codecov-action@v5
3650

3751
linux:
3852
runs-on: ubuntu-latest
53+
continue-on-error: true
3954
strategy:
4055
matrix:
4156
swift:
@@ -46,10 +61,26 @@ jobs:
4661
- swift:5.8
4762
- swift:5.9
4863
- swift:5.10
64+
<<<<<<< HEAD
4965
container:
5066
image: ${{ matrix.swift }}
5167
steps:
5268
- uses: actions/checkout@v4
69+
=======
70+
# - swift:6.0 strangely fails
71+
- swift:6.1
72+
- swift:6.2
73+
container:
74+
image: ${{ matrix.swift }}
75+
steps:
76+
- uses: actions/checkout@v1
77+
78+
- name: Get Swift version
79+
id: swift
80+
run: |
81+
ver=$(swift --version | head -1 | sed 's/.*Swift version \([0-9]*\).*/\1/')
82+
echo "marketing-version=$ver" >> $GITHUB_OUTPUT
83+
>>>>>>> origin/master
5384

5485
- run: useradd -ms /bin/bash mxcl
5586
- run: chown -R mxcl .
@@ -64,12 +95,12 @@ jobs:
6495
echo "Swift version: $version (marketing: $marketing_version)"
6596
6697
- run: echo ARGS=--enable-code-coverage >> $GITHUB_ENV
67-
if: ${{ steps.swift.outputs.marketing-version > 5 }}
98+
if: ${{ steps.swift.outputs.marketing-version > 6.1 }}
6899

69100
- run: su mxcl -c "swift test --parallel $ARGS"
70101

71102
- name: Generate `.lcov`
72-
if: ${{ steps.swift.outputs.marketing-version > 5 }}
103+
if: ${{ steps.swift.outputs.marketing-version > 6.1 }}
73104
run: |
74105
apt-get -qq update && apt-get -qq install curl
75106
b=$(swift build --show-bin-path)
@@ -81,7 +112,7 @@ jobs:
81112
> info.lcov
82113
83114
- uses: codecov/codecov-action@v1
84-
if: ${{ steps.swift.outputs.marketing-version > 5 }}
115+
if: ${{ steps.swift.outputs.marketing-version > 6.1 }}
85116
with:
86117
file: ./info.lcov
87118

Sources/Extensions.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,22 @@ public extension Bundle {
4444
/// Extensions on `String` that work with `Path` rather than `String` or `URL`
4545
public extension String {
4646
/// Initializes this `String` with the contents of the provided path.
47+
/// - SeeAlso: `init(contentsOf:encoding:)`
48+
@available(macOS, deprecated: 15, message: "Use `init(contentsOf:encoding:)` instead")
49+
@available(iOS, deprecated: 18, message: "Use `init(contentsOf:encoding:)` instead")
50+
@available(tvOS, deprecated: 18, message: "Use `init(contentsOf:encoding:)` instead")
51+
@available(watchOS, deprecated: 11, message: "Use `init(contentsOf:encoding:)` instead")
4752
@inlinable
4853
init<P: Pathish>(contentsOf path: P) throws {
4954
try self.init(contentsOfFile: path.string)
5055
}
5156

57+
/// Initializes this `String` with the contents of the provided path interpreted using a given encoding.
58+
@inlinable
59+
init<P: Pathish>(contentsOf path: P, encoding: String.Encoding) throws {
60+
try self.init(contentsOfFile: path.string, encoding: encoding)
61+
}
62+
5263
/// - Returns: `to` to allow chaining
5364
@inlinable
5465
@discardableResult

Tests/PathTests/PathTests.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,13 @@ class PathTests: XCTestCase {
496496
}
497497
}
498498

499+
func testStringEncodingExtensions() throws {
500+
let string = try String(contentsOf: Path(#file)!, encoding: .utf8)
501+
try Path.mktemp { tmpdir in
502+
_ = try string.write(to: tmpdir.foo, encoding: .utf8)
503+
}
504+
}
505+
499506
func testFileHandleExtensions() throws {
500507
_ = try FileHandle(forReadingAt: Path(#file)!)
501508
_ = try FileHandle(forWritingAt: Path(#file)!)

0 commit comments

Comments
 (0)