From 10cd5bddc91280009d6951e34a67b1a01c7e2166 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 3 Feb 2021 05:15:13 +0100 Subject: [PATCH] Add CI --- .cargo/config | 2 ++ .github/workflows/rust.yml | 24 ++++++++++++++++++++++++ embassy-net/Cargo.toml | 1 + embassy-net/src/tcp_socket.rs | 1 - test-build.sh | 26 +++++++------------------- 5 files changed, 34 insertions(+), 20 deletions(-) create mode 100644 .cargo/config create mode 100644 .github/workflows/rust.yml diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 00000000..93b20ab3 --- /dev/null +++ b/.cargo/config @@ -0,0 +1,2 @@ +[unstable] +namespaced-features = true \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 00000000..a0eefd3a --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,24 @@ +name: Rust + +on: + push: + branches: [master] + pull_request: + branches: [master] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + target: thumbv7em-none-eabi + override: true + - name: Build + run: ./test-build.sh diff --git a/embassy-net/Cargo.toml b/embassy-net/Cargo.toml index aec6b796..185992dd 100644 --- a/embassy-net/Cargo.toml +++ b/embassy-net/Cargo.toml @@ -11,6 +11,7 @@ defmt-debug = [] defmt-info = [] defmt-warn = [] defmt-error = [] +defmt = [ "dep:defmt", "smoltcp/defmt" ] [dependencies] diff --git a/embassy-net/src/tcp_socket.rs b/embassy-net/src/tcp_socket.rs index 7f4eb014..eab8189d 100644 --- a/embassy-net/src/tcp_socket.rs +++ b/embassy-net/src/tcp_socket.rs @@ -112,7 +112,6 @@ impl<'a> TcpSocket<'a> { } fn to_ioerr(e: Error) -> io::Error { - warn!("smoltcp err: {:?}", e); // todo io::Error::Other } diff --git a/test-build.sh b/test-build.sh index f67cc5b2..ec35f5da 100755 --- a/test-build.sh +++ b/test-build.sh @@ -2,24 +2,12 @@ set -euxo pipefail -# embassy std -(cd embassy; cargo build --features log,std) +# build for std +(cd embassy-net; cargo build --features log) -# embassy embedded -(cd embassy; cargo build --target thumbv7em-none-eabi) -(cd embassy; cargo build --target thumbv7em-none-eabi --features log) -(cd embassy; cargo build --target thumbv7em-none-eabi --features defmt) - -# embassy-nrf - -(cd embassy-nrf-examples; cargo build --target thumbv7em-none-eabi --bins) - -(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52810) -#(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52811) # nrf52811-hal doesn't exist yet -(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52832) -(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52833) -(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52840) - -(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52840,log) -(cd embassy-nrf; cargo build --target thumbv7em-none-eabi --features 52840,defmt) +# build for embedded +(cd embassy-net; cargo build --target thumbv7em-none-eabi --features log) +(cd embassy-net; cargo build --target thumbv7em-none-eabi --features defmt) +# build examples +(cd embassy-net-examples; cargo build)