Skip to content

Commit ad682b4

Browse files
committed
[ADD] Run Linux CI
1 parent 8992c75 commit ad682b4

File tree

6 files changed

+93
-47
lines changed

6 files changed

+93
-47
lines changed

.github/workflows/CI.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [ develop ]
6+
7+
jobs:
8+
macos:
9+
runs-on: macos-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Build
13+
run: swift build -v
14+
- name: Tests
15+
run: swift test -v
16+
linux:
17+
runs-on: ubuntu-latest
18+
container:
19+
image: swift:5.5-bionic
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Build
23+
run: swift build -v
24+
- name: Tests
25+
run: swift test -v

.github/workflows/swift.yml

-19
This file was deleted.

Package.resolved

+9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
"version": "2.0.1"
2020
}
2121
},
22+
{
23+
"package": "OpenCombine",
24+
"repositoryURL": "https://github.com/OpenCombine/OpenCombine.git",
25+
"state": {
26+
"branch": null,
27+
"revision": "9cf67e363738dbab61b47fb5eaed78d3db31e5ee",
28+
"version": "0.13.0"
29+
}
30+
},
2231
{
2332
"package": "secp256k1",
2433
"repositoryURL": "https://github.com/Boilertalk/secp256k1.swift",

Package.swift

+43-28
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,50 @@ let package = Package(
1313
dependencies: [
1414
.package(name: "BigInt", url: "https://github.com/attaswift/BigInt", from: "5.0.0"),
1515
.package(name: "GenericJSON", url: "https://github.com/zoul/generic-json-swift", from: "2.0.0"),
16-
.package(name: "secp256k1", url: "https://github.com/Boilertalk/secp256k1.swift", from: "0.1.0")
16+
.package(name: "secp256k1", url: "https://github.com/Boilertalk/secp256k1.swift", from: "0.1.0"),
17+
.package(url: "https://github.com/OpenCombine/OpenCombine.git", from: "0.13.0")
1718
],
1819
targets: [
19-
.target(name: "web3",
20-
dependencies:
21-
[.target(name: "keccaktiny"),
22-
.target(name: "aes"),
23-
.target(name: "Internal_CryptoSwift_PBDKF2"),
24-
"BigInt",
25-
"GenericJSON",
26-
"secp256k1"],
27-
path: "web3swift/src"),
28-
.target(name: "keccaktiny",
29-
dependencies: [],
30-
path: "web3swift/lib/keccak-tiny",
31-
exclude: ["module.map"]),
32-
.target(name: "aes",
33-
dependencies: [],
34-
path: "web3swift/lib/aes",
35-
exclude: ["module.map"]),
36-
.target(name: "Internal_CryptoSwift_PBDKF2",
37-
dependencies: [],
38-
path: "web3swift/lib/CryptoSwift"),
39-
.testTarget(name: "web3swiftTests",
40-
dependencies: ["web3"],
41-
path: "web3sTests",
42-
resources: [
43-
.copy("Resources/rlptests.json"),
44-
.copy("Account/cryptofights_712.json")
45-
]),
20+
.target(
21+
name: "web3",
22+
dependencies:
23+
[
24+
.target(name: "keccaktiny"),
25+
.target(name: "aes"),
26+
.target(name: "Internal_CryptoSwift_PBDKF2"),
27+
"BigInt",
28+
"GenericJSON",
29+
"secp256k1",
30+
"OpenCombine",
31+
.product(name: "OpenCombineFoundation", package: "OpenCombine"),
32+
],
33+
path: "web3swift/src"
34+
),
35+
.target(
36+
name: "keccaktiny",
37+
dependencies: [],
38+
path: "web3swift/lib/keccak-tiny",
39+
exclude: ["module.map"]
40+
),
41+
.target(
42+
name: "aes",
43+
dependencies: [],
44+
path: "web3swift/lib/aes",
45+
exclude: ["module.map"]
46+
),
47+
.target(
48+
name: "Internal_CryptoSwift_PBDKF2",
49+
dependencies: [],
50+
path: "web3swift/lib/CryptoSwift"
51+
),
52+
.testTarget(
53+
name: "web3swiftTests",
54+
dependencies: ["web3"],
55+
path: "web3sTests",
56+
resources: [
57+
.copy("Resources/rlptests.json"),
58+
.copy("Account/cryptofights_712.json")
59+
]
60+
),
4661
]
4762
)

docker-run.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#/bin/bash
2+
3+
docker run --rm --privileged \
4+
--interactive --tty \
5+
--name swift-5.5 \
6+
--volume "$(pwd):/web3swift" \
7+
--workdir "/web3swift" \
8+
swift:5.5 /bin/bash

web3swift/src/Client/EthereumClient+Call.swift

+8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77
//
88

99
import Foundation
10+
#if canImport(Combine)
1011
import Combine
12+
#else
13+
import OpenCombine
14+
import OpenCombineFoundation
15+
#endif
16+
#if canImport(FoundationNetworking)
17+
import FoundationNetworking
18+
#endif
1119

1220
public enum OffchainReadError: Error {
1321
case network

0 commit comments

Comments
 (0)