Skip to content

Commit

Permalink
ci: fix examples, add cargo test, move to nightly compiler
Browse files Browse the repository at this point in the history
hopefully faster
  • Loading branch information
beni69 committed Aug 4, 2023
1 parent 407415c commit 82388b4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 2 additions & 2 deletions client/examples/gpio_in_async.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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?;
Expand Down
13 changes: 13 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

1 comment on commit 82388b4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Artifacts

View all

base roland
aarch64-unknown-linux-gnu Download Download
aarch64-unknown-linux-musl Download Download
armv7-unknown-linux-gnueabihf Download Download
armv7-unknown-linux-musleabihf Download Download
x86_64-pc-windows-msvc Download Download
x86_64-unknown-linux-gnu Download Download
x86_64-unknown-linux-musl Download Download

Please sign in to comment.