Skip to content

Commit 8d06bc7

Browse files
committed
fix ci
1 parent 7edbcaf commit 8d06bc7

8 files changed

+72
-54
lines changed

.github/workflows/ci.yml

+47-42
Original file line numberDiff line numberDiff line change
@@ -15,87 +15,92 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18-
linux:
18+
linux-build:
19+
name: Linux (Swift ${{ matrix.swift }})
1920
runs-on: ubuntu-20.04
2021
strategy:
2122
matrix:
2223
swift:
23-
- 4.0.3
24-
- 4.1.3
25-
- 4.2.4
24+
- '4.0'
25+
- '4.1'
26+
- '4.2'
2627
container:
2728
image: swift:${{ matrix.swift }}
2829
steps:
29-
- uses: actions/checkout@v4.1.7
30+
- uses: actions/checkout@v1 # DO NOT UPDATE ∵ failure on older containers due to old glibc
3031
- run: swift build -Xswiftc -warnings-as-errors -Xswiftc -swift-version -Xswiftc 3
31-
- run: swift build # generated linuxmain requires Swift 5 sadly
32+
- run: swift build # can’t test ∵ generated linuxmain requires Swift 5
3233

33-
linux-code-cov:
34-
name: linux
35-
runs-on: ubuntu-20.04
34+
linux-test:
35+
name: Linux (Swift ${{ matrix.swift }})
36+
runs-on: ubuntu-latest
37+
continue-on-error: true
3638
strategy:
3739
matrix:
3840
swift:
3941
- '5.0'
40-
- 5.1
41-
- 5.2
42-
- 5.3
43-
- 5.4
44-
- 5.5
45-
- 5.6
42+
- '5.1'
43+
- '5.2'
44+
- '5.3'
45+
- '5.4'
46+
- '5.5'
47+
- '5.6'
48+
- '5.7'
49+
- '5.8'
50+
- '5.9'
51+
- '5.10'
52+
- '6.0'
4653
container:
4754
image: swift:${{ matrix.swift }}
4855
steps:
49-
- uses: actions/checkout@v4.1.7
56+
- uses: actions/checkout@v1 # DO NOT UPDATE ∵ failure on older containers due to old glibc
5057
- run: swift build -Xswiftc -warnings-as-errors -Xswiftc -swift-version -Xswiftc 4
58+
if: ${{ matrix.swift < 6 }}
5159
- run: swift build -Xswiftc -warnings-as-errors -Xswiftc -swift-version -Xswiftc 4.2
60+
if: ${{ matrix.swift < 6 }}
5261
- run: swift test --enable-code-coverage --parallel
5362

5463
- name: Generate Coverage Report
55-
if: ${{ matrix.swift < 5.4 }} # fails for SOME REASON
64+
if: ${{ matrix.swift >= 6 }}
5665
run: |
5766
apt-get -qq update
58-
apt-get -qq install llvm-10 curl
59-
export b=$(swift build --show-bin-path) && llvm-cov-10 \
67+
apt-get -qq install llvm-18 curl
68+
export b=$(swift build --show-bin-path) && llvm-cov-18 \
6069
export -format lcov \
6170
-instr-profile=$b/codecov/default.profdata \
6271
--ignore-filename-regex='\.build/' \
6372
$b/*.xctest \
6473
> info.lcov
74+
6575
- uses: codecov/codecov-action@v1
6676
with:
6777
file: ./info.lcov
68-
69-
verify-linuxmain:
70-
runs-on: macos-latest
71-
name: linux (validate manifests)
72-
steps:
73-
- uses: actions/checkout@v4.1.7
74-
- run: swift test --generate-linuxmain
75-
- run: git diff --exit-code
78+
if: ${{ matrix.swift >= 6 }}
7679

7780
test:
78-
runs-on: macos-14
81+
runs-on: macos-latest
82+
name: ${{ matrix.platform }}
83+
continue-on-error: true
7984
strategy:
8085
matrix:
81-
dst:
82-
- "platform=macOS,arch=arm64,id=0000FE00-392BB8A41C01F642"
83-
- "platform=iOS Simulator,OS=17.0.1,name=iPhone 14"
84-
- "platform=tvOS Simulator,OS=17.2,name=Apple TV"
86+
platform:
87+
- macOS
88+
- watchOS
89+
- tvOS
90+
- iOS
91+
# - mac-catalyst
92+
# - visionOS
93+
# ^^ both are unavailable in the github-hosted runners
8594
steps:
86-
- uses: maxim-lobanov/setup-xcode@v1
87-
with:
88-
xcode-version: 15.2
89-
- uses: actions/checkout@v4.1.7
90-
- uses: sersoft-gmbh/xcodebuild-action@v1
95+
- uses: actions/checkout@v4
96+
- uses: mxcl/xcodebuild@v3
9197
with:
92-
project: PromiseKit.xcodeproj
93-
scheme: PromiseKit
94-
destination: ${{ matrix.dst }}
95-
action: test
96-
enable-code-coverage: true
98+
platform: ${{ matrix.platform }}
99+
code-coverage: true
97100
- uses: codecov/codecov-action@v1
101+
98102
test-android:
103+
name: Android
99104
runs-on: ubuntu-latest
100105
steps:
101106
- uses: actions/checkout@v4

Tests/A+/XCTestManifests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#if !canImport(ObjectiveC)
22
import XCTest
33

4-
#if os(Linux) || os(Android)
4+
#if os(Android)
55
extension XCTestExpectation {
66
func fulfill() {
77
fulfill(#file, line: #line)

Tests/CorePromise/CancellableErrorTests.swift

+10-9
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,17 @@ class CancellationTests: XCTestCase {
108108
#endif
109109

110110
#if canImport(StoreKit)
111-
do {
112-
let err = SKError(.paymentCancelled)
113-
XCTAssertTrue(err.isCancelled)
114-
throw err
115-
} catch {
116-
XCTAssertTrue(error.isCancelled)
111+
if #available(watchOS 6.2, *) {
112+
do {
113+
let err = SKError(.paymentCancelled)
114+
XCTAssertTrue(err.isCancelled)
115+
throw err
116+
} catch {
117+
XCTAssertTrue(error.isCancelled)
118+
}
119+
120+
XCTAssertFalse(SKError(.clientInvalid).isCancelled)
117121
}
118-
119-
XCTAssertFalse(SKError(.clientInvalid).isCancelled)
120-
121122
#endif
122123
}
123124

Tests/JS-A+/AllTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Created by Lois Di Qual on 2/28/18.
66
//
77

8-
#if swift(>=3.2)
8+
#if swift(>=3.2) && !os(watchOS)
99

1010
import XCTest
1111
import PromiseKit

Tests/JS-A+/JSAdapter.swift

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by Lois Di Qual on 3/2/18.
66
//
77

8+
#if !os(watchOS)
9+
810
import Foundation
911
import JavaScriptCore
1012
import PromiseKit
@@ -51,3 +53,5 @@ enum JSAdapter {
5153
return object
5254
}
5355
}
56+
57+
#endif

Tests/JS-A+/JSPromise.swift

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by Lois Di Qual on 3/1/18.
66
//
77

8+
#if !os(watchOS)
9+
810
import Foundation
911
import XCTest
1012
import PromiseKit
@@ -92,3 +94,5 @@ class JSPromise: NSObject, JSPromiseProtocol {
9294
return JSPromise(promise: newPromise)
9395
}
9496
}
97+
98+
#endif

Tests/JS-A+/JSUtils.swift

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by Lois Di Qual on 3/2/18.
66
//
77

8+
#if !os(watchOS)
9+
810
import Foundation
911
import JavaScriptCore
1012

@@ -114,3 +116,5 @@ extension String {
114116
}
115117
}
116118
#endif
119+
120+
#endif

Tests/JS-A+/MockNodeEnvironment.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Created by Lois Di Qual on 3/1/18.
66
//
77

8-
#if swift(>=3.2)
8+
#if swift(>=3.2) && !os(watchOS)
99

1010
import Foundation
1111
import JavaScriptCore

0 commit comments

Comments
 (0)