Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature sets CI #1254

Merged
merged 13 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/bindings-nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Nodejs bindings checks

on:
push:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
thibault-martinez marked this conversation as resolved.
Show resolved Hide resolved
paths:
- ".github/actions/**"
- "**.rs" # Include all rust files
Expand All @@ -15,7 +15,7 @@ on:
- "bindings/nodejs/**"
- ".github/workflows/bindings-nodejs.yml"
pull_request:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
paths:
- ".github/actions/**"
- "**.rs" # Include all rust files
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/bindings-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Python bindings checks

on:
push:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
paths:
- ".github/actions/**"
- "**.rs" # Include all rust files
Expand All @@ -15,7 +15,7 @@ on:
- "bindings/python/**"
- ".github/workflows/bindings-python.yml"
pull_request:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
paths:
- ".github/actions/**"
- "**.rs" # Include all rust files
Expand Down Expand Up @@ -120,4 +120,3 @@ jobs:
- name: Run tests
working-directory: bindings/python
run: tox

4 changes: 2 additions & 2 deletions .github/workflows/bindings-wallet-nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Nodejs bindings checks (wallet)

on:
push:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
paths:
- ".github/actions/**"
- "**.rs" # Include all rust files
Expand All @@ -16,7 +16,7 @@ on:
- ".github/workflows/bindings-wallet-nodejs.yml"
- ".patches/*"
pull_request:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
paths:
- ".github/actions/**"
- "**.rs" # Include all rust files
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bindings-wasm.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Wasm bindings checks
on:
push:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
paths:
- ".github/actions/**"
- "**.rs" # Include all rust files
Expand All @@ -15,7 +15,7 @@ on:
- "bindings/nodejs/**"
- ".github/workflows/bindings-wasm.yml"
pull_request:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
paths:
- ".github/actions/**"
- "**.rs" # Include all rust files
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and Run Tests

on:
push:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
paths:
- ".cargo/config.toml"
- ".github/workflows/build-and-test.yml"
Expand All @@ -12,7 +12,7 @@ on:
- "**Cargo.lock" # Include all Cargo.lock files
- "!**/bindings/**" # Exclude all bindings
pull_request:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
paths:
- ".cargo/config.toml"
- ".github/workflows/build-and-test.yml"
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/common-features.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Common Feature Sets
on:
push:
branches: [develop, production, "1.1"]
paths:
- ".cargo/config.toml"
- ".github/workflows/common-features.yml"
- ".github/actions/**"
- "**.rs" # Include all rust files
- "**Cargo.toml" # Include all Cargo.toml files
- "**Cargo.lock" # Include all Cargo.lock files
- "!**/bindings/**" # Exclude all bindings
pull_request:
branches: [develop, production, "1.1"]
paths:
- ".cargo/config.toml"
- ".github/workflows/common-features.yml"
- ".github/actions/**"
- "**.rs" # Include all rust files
- "**Cargo.toml" # Include all Cargo.toml files
- "**Cargo.lock" # Include all Cargo.lock files
- "!**/bindings/**" # Exclude all bindings

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_INCREMENTAL: 0

jobs:
common-sets:
name: Check common feature sets
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
set:
- pow
- irc_27
- irc_30
- client,private_key_secret_manager
- client,mqtt
- client,participation
- wallet,storage
- wallet,stronghold
- wallet,rocksdb
- wallet,participation
- wallet,events
- wallet,events,ledger_nano

steps:
- name: Checkout the Source Code
uses: actions/checkout@v3

- name: Set up Rust
uses: ./.github/actions/setup-rust

# Required for ledger-nano
- name: Install required packages (Ubuntu)
run: |
sudo apt-get update
sudo apt-get install libudev-dev libusb-1.0-0-dev

- name: Check features [ ${{ matrix.set }} ]
run: cargo check --no-default-features -p iota-sdk -F ${{ matrix.set }}
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test coverage

on:
push:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
paths:
- ".cargo/config.toml"
- ".github/workflows/coverage.yml"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Linting
on:
push:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
paths:
- ".cargo/config.toml"
- ".github/workflows/lint.yml"
Expand All @@ -11,7 +11,7 @@ on:
- "**Cargo.lock" # Include all Cargo.lock files
- "!**/bindings/**" # Exclude all bindings
pull_request:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
paths:
- ".cargo/config.toml"
- ".github/workflows/lint.yml"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/private-tangle-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and run specific tests on a private tangle

on:
push:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
paths:
- ".cargo/config.toml"
- ".github/workflows/private-tangle-tests.yml"
Expand All @@ -14,7 +14,7 @@ on:
- "**Cargo.lock"
- "!cli/**" # Exclude CLI
pull_request:
branches: [develop, production, 1.1]
branches: [develop, production, "1.1"]
paths:
- ".cargo/config.toml"
- ".github/workflows/private-tangle-tests.yml"
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions bindings/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ serde = { version = "1.0.188", default-features = false }
serde_json = { version = "1.0.107", default-features = false }
thiserror = { version = "1.0.48", default-features = false }
tokio = { version = "1.32.0", default-features = false }
url = { version = "2.4.1", default-features = false, features = [
"serde",
] }
zeroize = { version = "1.6.0", default-features = false }

[features]
Expand Down
2 changes: 1 addition & 1 deletion bindings/core/src/message_interface_old/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ use iota_sdk::{
account::{types::AccountIdentifier, SyncOptions},
ClientOptions,
},
Url,
};
use serde::{Deserialize, Serialize};
use url::Url;

use super::account_method::AccountMethod;

Expand Down
2 changes: 1 addition & 1 deletion bindings/core/src/method/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ use iota_sdk::{
},
ClientOptions,
},
Url,
};
use serde::{Deserialize, Serialize};
use url::Url;

use crate::method::account::AccountMethod;
#[cfg(feature = "stronghold")]
Expand Down
37 changes: 18 additions & 19 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,20 +141,19 @@ tokio = { version = "1.32.0", default-features = false, features = [
default = ["client", "wallet", "tls"]

events = []
irc_27 = ["url", "serde"]
irc_30 = ["url", "serde"]
ledger_nano = ["iota-ledger-nano"]
mqtt = ["std", "regex", "rumqttc", "dep:once_cell"]
irc_27 = ["serde", "dep:url"]
irc_30 = ["serde", "dep:url"]
ledger_nano = ["dep:iota-ledger-nano"]
mqtt = ["std", "tls", "dep:regex", "dep:rumqttc", "dep:once_cell"]
participation = ["storage"]
pow = ["std", "num_cpus", "iota-crypto/curl-p"]
rand = ["dep:rand"]
rocksdb = ["dep:rocksdb", "storage"]
pow = ["std", "iota-crypto/curl-p", "dep:num_cpus"]
rocksdb = ["storage", "dep:rocksdb"]
serde = [
"serde_repr",
"hashbrown/serde",
"packable/serde",
"primitive-types/serde_no_std",
"zeroize?/serde",
"dep:serde_repr",
]
std = [
"packable/std",
Expand All @@ -177,34 +176,34 @@ storage = [
"dep:heck",
]
stronghold = [
"iota_stronghold",
"iota-crypto/chacha",
"dep:iota_stronghold",
"dep:time",
"dep:anymap",
"dep:once_cell",
"dep:heck",
]
tls = ["reqwest?/rustls-tls", "rumqttc?/use-rustls"]
private_key_secret_manager = ["bs58"]
private_key_secret_manager = ["dep:bs58"]

client = [
"pow",
"tokio",
"zeroize",
"url",
"reqwest",
"async-trait",
"log",
"thiserror",
"futures",
"serde",
"instant",
"iota-crypto/bip39",
"iota-crypto/bip39-en",
"iota-crypto/slip10",
"iota-crypto/keccak",
"iota-crypto/bip44",
"iota-crypto/random",
"dep:thiserror",
"dep:futures",
"dep:instant",
"dep:tokio",
"dep:zeroize",
"dep:url",
"dep:reqwest",
"dep:async-trait",
"dep:log",
]
wallet = ["client"]

Expand Down
3 changes: 2 additions & 1 deletion sdk/examples/wallet/participation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
use iota_sdk::{
client::node_manager::node::Node,
wallet::{account::types::participation::ParticipationEventRegistrationOptions, Result},
Url, Wallet,
Wallet,
};
use url::Url;
thibault-martinez marked this conversation as resolved.
Show resolved Hide resolved

// The node that runs the participation plugin
const PARTICPATION_NODE_URL: &str = "https://api.testnet.shimmer.network";
Expand Down
6 changes: 6 additions & 0 deletions sdk/src/client/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,10 @@ impl ClientInner {
};
Ok(())
}

/// Resize the client's request pool
#[cfg(not(target_family = "wasm"))]
pub async fn resize_request_pool(&self, new_size: usize) {
self.request_pool.resize(new_size).await;
}
}
3 changes: 1 addition & 2 deletions sdk/src/client/node_manager/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
use std::hash::Hash;

use serde::{Deserialize, Serialize};

use crate::Url;
use url::Url;
thibault-martinez marked this conversation as resolved.
Show resolved Hide resolved

/// Node authentication object.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, Hash)]
Expand Down
2 changes: 0 additions & 2 deletions sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ pub mod utils;
pub use crypto;
pub use packable;
pub use primitive_types::U256;
#[cfg(feature = "url")]
pub use url::Url;
thibault-martinez marked this conversation as resolved.
Show resolved Hide resolved

#[cfg(feature = "wallet")]
pub type Wallet = self::wallet::Wallet<client::secret::SecretManager>;
2 changes: 1 addition & 1 deletion sdk/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#[cfg(feature = "serde")]
pub mod serde;

#[cfg(feature = "instant")]
#[cfg(feature = "client")]
pub fn unix_timestamp_now() -> core::time::Duration {
instant::SystemTime::now()
.duration_since(instant::SystemTime::UNIX_EPOCH)
Expand Down
3 changes: 2 additions & 1 deletion sdk/src/wallet/core/operations/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

use std::collections::{HashMap, HashSet};

use url::Url;

use super::storage::SaveLoadWallet;
use crate::{
client::{
Expand All @@ -14,7 +16,6 @@ use crate::{
Client, ClientBuilder,
},
wallet::{Wallet, WalletBuilder},
Url,
};

impl<S: 'static + SecretManage> Wallet<S> {
Expand Down
Loading
Loading