diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 00000000..88ade873 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,25 @@ +name: CI + +on: + pull_request: + branches: [ develop ] + +jobs: + # macos: + # runs-on: macos-latest + # steps: + # - uses: actions/checkout@v3 + # - name: Build + # run: swift build -v + # - name: Tests + # run: swift test -v + linux: + runs-on: ubuntu-latest + container: + image: swift:latest + steps: + - uses: actions/checkout@v3 + - name: Build + run: swift build -v + - name: Tests + run: swift test -v \ No newline at end of file diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml deleted file mode 100644 index a9c0c81c..00000000 --- a/.github/workflows/swift.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Swift - -on: - push: - branches: [ develop ] - pull_request: - branches: [ develop ] - -jobs: - build: - - runs-on: macos-latest - - steps: - - uses: actions/checkout@v3 - - name: Build - run: swift build -v - - name: Run tests - run: swift test -v diff --git a/Package.resolved b/Package.resolved index 309c126e..ebbd8518 100644 --- a/Package.resolved +++ b/Package.resolved @@ -19,6 +19,15 @@ "version": "2.0.1" } }, + { + "package": "OpenCombine", + "repositoryURL": "https://github.com/OpenCombine/OpenCombine.git", + "state": { + "branch": null, + "revision": "9cf67e363738dbab61b47fb5eaed78d3db31e5ee", + "version": "0.13.0" + } + }, { "package": "secp256k1", "repositoryURL": "https://github.com/Boilertalk/secp256k1.swift", diff --git a/Package.swift b/Package.swift index 9639b587..b8242f12 100644 --- a/Package.swift +++ b/Package.swift @@ -13,35 +13,50 @@ let package = Package( dependencies: [ .package(name: "BigInt", url: "https://github.com/attaswift/BigInt", from: "5.0.0"), .package(name: "GenericJSON", url: "https://github.com/zoul/generic-json-swift", from: "2.0.0"), - .package(name: "secp256k1", url: "https://github.com/Boilertalk/secp256k1.swift", from: "0.1.0") + .package(name: "secp256k1", url: "https://github.com/Boilertalk/secp256k1.swift", from: "0.1.0"), + .package(url: "https://github.com/OpenCombine/OpenCombine.git", from: "0.13.0") ], targets: [ - .target(name: "web3", - dependencies: - [.target(name: "keccaktiny"), - .target(name: "aes"), - .target(name: "Internal_CryptoSwift_PBDKF2"), - "BigInt", - "GenericJSON", - "secp256k1"], - path: "web3swift/src"), - .target(name: "keccaktiny", - dependencies: [], - path: "web3swift/lib/keccak-tiny", - exclude: ["module.map"]), - .target(name: "aes", - dependencies: [], - path: "web3swift/lib/aes", - exclude: ["module.map"]), - .target(name: "Internal_CryptoSwift_PBDKF2", - dependencies: [], - path: "web3swift/lib/CryptoSwift"), - .testTarget(name: "web3swiftTests", - dependencies: ["web3"], - path: "web3sTests", - resources: [ - .copy("Resources/rlptests.json"), - .copy("Account/cryptofights_712.json") - ]), + .target( + name: "web3", + dependencies: + [ + .target(name: "keccaktiny"), + .target(name: "aes"), + .target(name: "Internal_CryptoSwift_PBDKF2"), + "BigInt", + "GenericJSON", + "secp256k1", + .product(name: "OpenCombine", package: "OpenCombine"), + .product(name: "OpenCombineFoundation", package: "OpenCombine") + ], + path: "web3swift/src" + ), + .target( + name: "keccaktiny", + dependencies: [], + path: "web3swift/lib/keccak-tiny", + exclude: ["module.map"] + ), + .target( + name: "aes", + dependencies: [], + path: "web3swift/lib/aes", + exclude: ["module.map"] + ), + .target( + name: "Internal_CryptoSwift_PBDKF2", + dependencies: [], + path: "web3swift/lib/CryptoSwift" + ), + .testTarget( + name: "web3swiftTests", + dependencies: ["web3"], + path: "web3sTests", + resources: [ + .copy("Resources/rlptests.json"), + .copy("Account/cryptofights_712.json") + ] + ), ] ) diff --git a/web3swift/src/Client/EthereumClient+Call.swift b/web3swift/src/Client/EthereumClient+Call.swift index a14e2644..2d472afd 100644 --- a/web3swift/src/Client/EthereumClient+Call.swift +++ b/web3swift/src/Client/EthereumClient+Call.swift @@ -7,7 +7,11 @@ // import Foundation +#if canImport(Combine) import Combine +#else +import OpenCombine +#endif public enum OffchainReadError: Error { case network