Skip to content

Commit 35cdd03

Browse files
authored
Add support for Linux (#4)
* Add CI workflows for testing Linux * Add FoundationNetworking imports for Linux
1 parent 6d5ee2d commit 35cdd03

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,16 @@ jobs:
2828
uses: actions/checkout@v3
2929
- name: Run Tests
3030
run: swift test
31+
linux:
32+
name: Linux (Swift ${{ matrix.swift }})
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
swift: ["5.5", "5.6"]
37+
runs-on: ubuntu-latest
38+
container: swift:${{ matrix.swift }}
39+
steps:
40+
- name: Checkout Repo
41+
uses: actions/checkout@v3
42+
- name: Run Tests
43+
run: swift test

Sources/HTTPHeaders/HTTPHeader.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import Foundation
2+
#if canImport(FoundationNetworking)
3+
import FoundationNetworking
4+
#endif
25

36
public struct HTTPHeader<T> {
47
public let field: String

Tests/HTTPHeadersTests/HTTPHeadersTests.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
import XCTest
1+
#if canImport(FoundationNetworking)
2+
import FoundationNetworking
3+
#endif
24
@testable import HTTPHeaders
5+
import XCTest
36

47
final class HTTPHeadersTests: XCTestCase {
58
func testParseString() throws {

0 commit comments

Comments
 (0)