Skip to content

Commit

Permalink
Add Android to CI (#126)
Browse files Browse the repository at this point in the history
* Add Android to CI

* Run tests only on platforms where Swift Testing is supported

* Remove indentation

---------

Co-authored-by: Mahdi Bahrami <[email protected]>
  • Loading branch information
fpseverino and MahdiBM authored Feb 26, 2025
1 parent 583d692 commit 46aadbe
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ jobs:
with_windows: true
with_musl: true
ios_scheme_name: multipart-kit
with_android: true
secrets: inherit
2 changes: 1 addition & 1 deletion .swift-format
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"indentation": {
"spaces": 4
},
"indentConditionalCompilationBlocks": true,
"indentConditionalCompilationBlocks": false,
"indentSwitchCaseLabels": false,
"lineBreakAroundMultilineExpressionChainComponents": false,
"lineBreakBeforeControlFlowKeywords": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if canImport(FoundationEssentials)
import FoundationEssentials
import FoundationEssentials
#else
import Foundation
import Foundation
#endif

extension FormDataDecoder.Decoder: SingleValueDecodingContainer {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#if canImport(FoundationEssentials)
import FoundationEssentials
import FoundationEssentials
#else
import Foundation
import Foundation
#endif

extension FormDataEncoder.Encoder: SingleValueEncodingContainer {
Expand Down
2 changes: 2 additions & 0 deletions Tests/MultipartKitTests/FormDataDecodingTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Testing)
import MultipartKit
import Testing

Expand Down Expand Up @@ -304,3 +305,4 @@ struct FormDataDecodingTests {
}

}
#endif // canImport(Testing)
6 changes: 4 additions & 2 deletions Tests/MultipartKitTests/FormDataEncodingTests.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#if canImport(Testing)
import MultipartKit
import Testing

#if canImport(FoundationEssentials)
import FoundationEssentials
import FoundationEssentials
#else
import Foundation
import Foundation
#endif

@Suite("Form Data Encoding Tests")
Expand Down Expand Up @@ -284,3 +285,4 @@ struct FormDataEncodingTests {
#expect(try FormDataDecoder().decode(AllTypes.self, from: multipart, boundary: "-") == value)
}
}
#endif // canImport(Testing)
2 changes: 2 additions & 0 deletions Tests/MultipartKitTests/ParserTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Testing)
import HTTPTypes
import MultipartKit
import Testing
Expand Down Expand Up @@ -269,3 +270,4 @@ struct ParserTests {
0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82,
]
}
#endif // canImport(Testing)
2 changes: 2 additions & 0 deletions Tests/MultipartKitTests/SerializerTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Testing)
import HTTPTypes
import MultipartKit
import Testing
Expand Down Expand Up @@ -29,3 +30,4 @@ struct SerializerTests {
#expect(serialized == expected)
}
}
#endif // canImport(Testing)

0 comments on commit 46aadbe

Please sign in to comment.