diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97485fa..232d2e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,13 +48,9 @@ jobs: args: --all-features - name: Check all possible feature combos - if: matrix.toolchain == 'stable' + if: matrix.toolchain == 'nightly' run: ./test.sh 2>&1 - - name: Run clippy - if: matrix.toolchain != 'stable' - run: cargo clippy --all-features - build: strategy: fail-fast: false diff --git a/client/Cargo.toml b/client/Cargo.toml index 10389f0..c938d3d 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -64,3 +64,7 @@ required-features = ["default", "roland"] [[example]] name = "async" required-features = ["roland", "async", "tcp", "http", "ws"] + +[[example]] +name = "gpio_in_async" +required-features = ["default", "gpio", "async"] diff --git a/client/examples/gpio_in_async.rs b/client/examples/gpio_in_async.rs index 5f25605..cd5deda 100644 --- a/client/examples/gpio_in_async.rs +++ b/client/examples/gpio_in_async.rs @@ -1,5 +1,5 @@ use roblib::gpio::{GpioAsync, OutputPinAsync, SubscribablePinAsync, TypedGpioAsync}; -use roblib_client::{async_robot::RobotAsync, logger::init_log, transports::ws::Ws, Result}; +use roblib_client::{async_robot::RobotAsync, logger::init_log, transports::tcp::TcpAsync, Result}; const IN: u8 = 2; const OUT: u8 = 3; @@ -12,7 +12,7 @@ async fn main() -> Result<()> { .nth(1) .unwrap_or_else(|| "localhost:1111".into()); - let robot = RobotAsync::new(Ws::connect(&ip).await?); + let robot = RobotAsync::new(TcpAsync::connect(&ip).await?); log::info!("setup pins"); let inp = robot.input_pin(IN).await?; diff --git a/test.sh b/test.sh index 5607d31..64b8bb2 100755 --- a/test.sh +++ b/test.sh @@ -9,4 +9,17 @@ set -e [ -n "$GITHUB_ACTIONS" ] && echo "##[group]roblib-macro" cargo clippy -p roblib-macro 2>&1 [ -n "$GITHUB_ACTIONS" ] && echo "##[endgroup]" + +[ -n "$GITHUB_ACTIONS" ] && echo "##[group]test: roblib" +cargo test --all-features -p roblib 2>&1 +[ -n "$GITHUB_ACTIONS" ] && echo "##[endgroup]" + +[ -n "$GITHUB_ACTIONS" ] && echo "##[group]test: roblib-server" +cargo test --all-features -p roblib-server 2>&1 +[ -n "$GITHUB_ACTIONS" ] && echo "##[endgroup]" + +[ -n "$GITHUB_ACTIONS" ] && echo "##[group]test: roblib-client" +cargo test --all-features -p roblib-client 2>&1 +[ -n "$GITHUB_ACTIONS" ] && echo "##[endgroup]" + exit 0