Skip to content

Commit fa424f1

Browse files
authored
Add tests for Linux (#161)
* Add tests for Linux * Disable NSPredicate for Linux * Fix tests * Using FoundationNetworking * Replace .atomicWrite with .atomic * Update workflow * Using FoundationXML * Add lexicographic order key formatting in Xcode's JSONs * Revert "Add lexicographic order key formatting in Xcode's JSONs" This reverts commit abad672. * Disable iOS tests for Linux
1 parent 10569c2 commit fa424f1

19 files changed

+61
-4
lines changed

.github/workflows/tests.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313

1414
jobs:
1515
test:
16-
name: Run tests
16+
name: Run tests on macOS
1717
runs-on: macos-12
1818
steps:
1919
- name: Checkout
@@ -23,3 +23,13 @@ jobs:
2323
- name: Build and test
2424
run: swift test --enable-code-coverage --disable-automatic-resolution
2525
shell: bash
26+
test-linux:
27+
name: Run tests on Linux
28+
runs-on: ubuntu-22.04
29+
container:
30+
image: swift:5.7.1-jammy
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v2
34+
- name: Build and test
35+
run: swift test --disable-automatic-resolution --skip XcodeExportTests

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import PackageDescription
66
let package = Package(
77
name: "figma-export",
88
platforms: [
9-
.macOS(.v10_13),
9+
.macOS(.v10_13)
1010
],
1111
products: [
1212
.executable(name: "figma-export", targets: ["FigmaExport"])

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,8 @@ If you want to export specific colors/icons/images you can list their names in t
396396

397397
`./figma-export colors` — Exports all the colors.
398398

399+
⚠️ Wildcard doesn't work on Linux.
400+
399401
Argument `-i` or `-input` specifies path to FigmaExport configuration file `figma-export.yaml`.
400402

401403
### Configuration

Sources/FigmaAPI/Client.swift

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

36
public typealias APIResult<Value> = Swift.Result<Value, Error>
47

Sources/FigmaAPI/Endpoint/BaseEndpoint.swift

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

36
/// Base Endpoint for application remote resource.
47
///

Sources/FigmaAPI/Endpoint/ComponentsEndpoint.swift

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

36
public struct ComponentsEndpoint: BaseEndpoint {
47

Sources/FigmaAPI/Endpoint/Endpoint.swift

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

36
/// The endpoint to work with a remote content.
47
public protocol Endpoint {

Sources/FigmaAPI/Endpoint/ImageEndpoint.swift

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

36
public class FormatParams: Encodable {
47
/// A number between 0.01 and 4, the image scaling factor

Sources/FigmaAPI/Endpoint/LatestReleaseEndpoint.swift

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

36
public struct LatestReleaseEndpoint: BaseEndpoint {
47

Sources/FigmaAPI/Endpoint/NodesEndpoint.swift

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

36
public struct NodesEndpoint: BaseEndpoint {
47
public typealias Content = [NodeId: Node]

0 commit comments

Comments
 (0)