diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d759ea8..1eb2191 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,3 +46,11 @@ jobs: - uses: codecov/codecov-action@v3 with: fail_ci_if_error: true # optional (default = false) + linux-test: + runs-on: ubuntu-latest + environment: default + + steps: + - uses: actions/checkout@v3 + - name: Run Tests + run: swift test --parallel \ No newline at end of file diff --git a/Package.swift b/Package.swift index 4985e23..0cabf59 100644 --- a/Package.swift +++ b/Package.swift @@ -2,47 +2,57 @@ import PackageDescription -let package = Package( - name: "swift-filter", - products: [ - .library( - name: "Filter", - targets: ["Filter"] - ), - .library( - name: "FilterNSPredicate", - targets: ["FilterNSPredicate"] - ), - .library( - name: "FilterClosure", - targets: ["FilterClosure"] - ), - ], - dependencies: [], - targets: [ - .target( - name: "Filter", - dependencies: [] - ), - .testTarget( - name: "FilterClosureTests", - dependencies: ["FilterClosure"] - ), - .testTarget( - name: "FilterNSPredicateTests", - dependencies: ["FilterNSPredicate"] - ), +var products: [Product] = [ + .library( + name: "Filter", + targets: ["Filter"] + ), + .library( + name: "FilterClosure", + targets: ["FilterClosure"] + ), +] + +var targets: [Target] = [ + .target(name: "Filter"), + .target( + name: "FilterClosure", + dependencies: [ + "Filter", + ] + ), + .testTarget( + name: "FilterClosureTests", + dependencies: [ + "FilterClosure", + ] + ), +] + +#if !os(Linux) && !os(Windows) + products.append(.library( + name: "FilterNSPredicate", + targets: ["FilterNSPredicate"] + )) + + targets.append(contentsOf: [ .target( name: "FilterNSPredicate", dependencies: [ "Filter", ] ), - .target( - name: "FilterClosure", + .testTarget( + name: "FilterNSPredicateTests", dependencies: [ - "Filter", + "FilterNSPredicate", ] ), - ] + ]) +#endif + +let package = Package( + name: "swift-filter", + products: products, + targets: targets ) diff --git a/README.md b/README.md index 1f87ba7..f7edbfc 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ [![CI](https://github.com/roanutil/swift-filter/actions/workflows/ci.yml/badge.svg)](https://github.com/roanutil/swift-filter/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/roanutil/swift-filter/branch/main/graph/badge.svg?token=86G7F92SM2)](https://codecov.io/gh/roanutil/swift-filter) -[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Froanutil%2FFilter%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/roanutil/swift-filter) -[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Froanutil%2FFilter%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/roanutil/swift-filter) +[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Froanutil%2Fswift-filter%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/roanutil/swift-filter) +[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Froanutil%2Fswift-filter%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/roanutil/swift-filter) Filter is a library that makes it easy to model filters in state and then create predicates from that state.