Skip to content

Commit 6ad40d1

Browse files
authored
Linux CI (#76)
* generate linux test files * update linux toolchain * linux ci * go back to original way * Remove non building tests on linux * Fix codable tests * Checking Linux bundles * See if anything in Bundle.main * Add warning for Linux devs who use Installation. * unwrap optional strings for Linux tests * updates * more * more updates * Don't run multithread tests on Linux * disabled more tests on linux * disable more * Disable another test * additional * Add codecov to linux * see if linux finds codecov files * Checking codecov on Linux * testing codecov * find codecov path * update codecov path * update * use json file * Update * update * another update * update * Nits
1 parent 304af69 commit 6ad40d1

16 files changed

+385
-314
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,15 @@ jobs:
9393
- uses: actions/checkout@v2
9494
- uses: sersoft-gmbh/[email protected]
9595
with:
96-
release-version: 5.3.2
96+
release-version: 5.3.3
9797
- name: Build
9898
run: swift build
99-
#- name: Test
100-
# run: swift test --enable-test-discovery
99+
- name: Test
100+
run: swift test --enable-test-discovery --enable-code-coverage
101+
- name: Prepare codecov
102+
run: llvm-cov export -format="lcov" .build/x86_64-unknown-linux-gnu/debug/ParseSwiftPackageTests.xctest -instr-profile .build/x86_64-unknown-linux-gnu/debug/codecov/default.profdata > info.lcov
103+
- name: Send codecov
104+
run: bash <(curl https://codecov.io/bash)
101105

102106
docs:
103107
needs: xcode-build-watchos

Sources/ParseSwift/Objects/ParseInstallation.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import AppKit
3333

3434
- warning: Only use `ParseInstallation.current` installations on the main thread as they
3535
require UIApplication for `badge`
36+
- warning: Linux developers should set `appName`, `appIdentifier`, and `appVersion`
37+
manually as `ParseSwift` doesn't have access to Bundle.main.
3638
*/
3739
public protocol ParseInstallation: ParseObject {
3840

@@ -241,7 +243,6 @@ extension ParseInstallation {
241243
guard let appInfo = Bundle.main.infoDictionary else {
242244
return
243245
}
244-
245246
#if !os(Linux)
246247
#if TARGET_OS_MACCATALYST
247248
// If using an Xcode new enough to know about Mac Catalyst:

Tests/ParseSwiftTests/AnyCodableTests/AnyCodableTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ class AnyCodableTests: XCTestCase {
3838
XCTFail(error.localizedDescription)
3939
}
4040
}
41+
42+
//Test has objective-c
43+
#if !os(Linux)
4144
func testJSONEncoding() {
4245
let dictionary: [String: AnyCodable] = [
4346
"boolean": true,
@@ -86,8 +89,5 @@ class AnyCodableTests: XCTestCase {
8689
XCTFail(error.localizedDescription)
8790
}
8891
}
89-
static var allTests = [
90-
("testJSONDecoding", testJSONDecoding),
91-
("testJSONEncoding", testJSONEncoding)
92-
]
92+
#endif
9393
}

Tests/ParseSwiftTests/AnyCodableTests/AnyDecodableTests.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,4 @@ class AnyDecodableTests: XCTestCase {
3838
XCTFail(error.localizedDescription)
3939
}
4040
}
41-
static var allTests = [
42-
("testJSONDecoding", testJSONDecoding)
43-
]
4441
}

Tests/ParseSwiftTests/AnyCodableTests/AnyEncodableTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import XCTest
22
@testable import ParseSwift
33

4+
//Test has objective-c
5+
#if !os(Linux)
46
class AnyEncodableTests: XCTestCase {
57
func testJSONEncoding() {
68
let dictionary: [String: AnyEncodable] = [
@@ -50,7 +52,5 @@ class AnyEncodableTests: XCTestCase {
5052
XCTFail(error.localizedDescription)
5153
}
5254
}
53-
static var allTests = [
54-
("testJSONEncoding", testJSONEncoding)
55-
]
5655
}
56+
#endif

0 commit comments

Comments
 (0)