diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9edffcded6..51fbb62cf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,6 +58,15 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest' }} run: cargo clippy --all-targets --all-features -- --deny warnings + - name: Install generic no_std target + # Generic no_std target architecture is x86_64-unknown-none + run: rustup target add x86_64-unknown-none + + - name: Perform no_std checks + run: cargo check --bin nostd_check --target x86_64-unknown-none --manifest-path ci/nostd-check/Cargo.toml + env: + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse + test: name: Run tests on ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -80,8 +89,8 @@ jobs: *windows*) echo "RUSTFLAGS=-Clink-arg=/DEBUG:NONE" >> $GITHUB_ENV ;; esac - - name: Install nextest - run: cargo install cargo-nextest --locked + - name: Install latest nextest + uses: taiki-e/install-action@nextest - name: Run tests run: cargo nextest run --exclude zenoh-examples --exclude zenoh-plugin-example --workspace @@ -106,24 +115,16 @@ jobs: CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse ASYNC_STD_THREAD_COUNT: 4 - nostd: - name: Run no_std checks + # NOTE: In GitHub repository settings, the "Require status checks to pass + # before merging" branch protection rule ensures that commits are only merged + # from branches where specific status checks have passed. These checks are + # specified manually as a list of workflow job names. Thus we use this extra + # job to signal whether all CI checks have passed. + ci: + name: CI status checks runs-on: ubuntu-latest - needs: check - strategy: - fail-fast: false - + needs: [check, test] + if: always() steps: - - name: Clone this repository - uses: actions/checkout@v4 - - - name: Install nightly Rust toolchain - # Generic no_std target architecture is x86_64-unknown-none - run: | - rustup override set nightly - rustup target add --toolchain nightly x86_64-unknown-none - - - name: Perform no_std checks - run: cargo check --bin nostd_check --target x86_64-unknown-none --manifest-path ci/nostd-check/Cargo.toml - env: - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse + - name: Check whether all jobs pass + run: echo '${{ toJson(needs) }}' | jq -e 'all(.result == "success")' diff --git a/ci/nostd-check/Cargo.toml b/ci/nostd-check/Cargo.toml index 187cdfff00..732b0969d2 100644 --- a/ci/nostd-check/Cargo.toml +++ b/ci/nostd-check/Cargo.toml @@ -16,9 +16,7 @@ name = "nostd-check" version = "0.1.0" repository = "https://github.com/eclipse-zenoh/zenoh" homepage = "http://zenoh.io" -authors = [ - "Davide Della Giustina ", -] +authors = ["Davide Della Giustina "] edition = "2021" license = "EPL-2.0 OR Apache-2.0" categories = ["network-programming"] @@ -26,7 +24,7 @@ description = "Internal crate for zenoh." [dependencies] getrandom = { version = "0.2.8", features = ["custom"] } -linked_list_allocator = "0.10.5" # Needs nightly toolchain +linked_list_allocator = "0.10.5" zenoh-buffers = { path = "../../commons/zenoh-buffers/", default-features = false } zenoh-codec = { path = "../../commons/zenoh-codec/", default-features = false } zenoh-protocol = { path = "../../commons/zenoh-protocol/", default-features = false } diff --git a/ci/nostd-check/rust-toolchain.toml b/ci/nostd-check/rust-toolchain.toml deleted file mode 100644 index 5d56faf9ae..0000000000 --- a/ci/nostd-check/rust-toolchain.toml +++ /dev/null @@ -1,2 +0,0 @@ -[toolchain] -channel = "nightly" diff --git a/ci/nostd-check/rust-toolchain.toml b/ci/nostd-check/rust-toolchain.toml new file mode 120000 index 0000000000..e01fe10aba --- /dev/null +++ b/ci/nostd-check/rust-toolchain.toml @@ -0,0 +1 @@ +../../rust-toolchain.toml \ No newline at end of file diff --git a/commons/zenoh-keyexpr/src/keyexpr_tree/impls/hashmap_impl.rs b/commons/zenoh-keyexpr/src/keyexpr_tree/impls/hashmap_impl.rs index 04a5d24201..72f830a912 100644 --- a/commons/zenoh-keyexpr/src/keyexpr_tree/impls/hashmap_impl.rs +++ b/commons/zenoh-keyexpr/src/keyexpr_tree/impls/hashmap_impl.rs @@ -30,6 +30,7 @@ use std::collections::{ use crate::keyexpr_tree::*; +#[cfg_attr(not(feature = "std"), allow(deprecated))] pub struct HashMapProvider( core::marker::PhantomData, ); diff --git a/commons/zenoh-keyexpr/src/keyexpr_tree/impls/keyed_set_impl.rs b/commons/zenoh-keyexpr/src/keyexpr_tree/impls/keyed_set_impl.rs index 0a4ce4f4b4..4fab65a850 100644 --- a/commons/zenoh-keyexpr/src/keyexpr_tree/impls/keyed_set_impl.rs +++ b/commons/zenoh-keyexpr/src/keyexpr_tree/impls/keyed_set_impl.rs @@ -23,6 +23,7 @@ use std::collections::hash_map::DefaultHasher; use crate::keyexpr_tree::*; use keyed_set::{KeyExtractor, KeyedSet}; +#[cfg_attr(not(feature = "std"), allow(deprecated))] pub struct KeyedSetProvider( core::marker::PhantomData, );