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

Reduce status checks #639

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
43 changes: 22 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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")'
6 changes: 2 additions & 4 deletions ci/nostd-check/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@ name = "nostd-check"
version = "0.1.0"
repository = "https://github.com/eclipse-zenoh/zenoh"
homepage = "http://zenoh.io"
authors = [
"Davide Della Giustina <[email protected]>",
]
authors = ["Davide Della Giustina <[email protected]>"]
edition = "2021"
license = "EPL-2.0 OR Apache-2.0"
categories = ["network-programming"]
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 }
Expand Down
2 changes: 0 additions & 2 deletions ci/nostd-check/rust-toolchain.toml

This file was deleted.

1 change: 1 addition & 0 deletions ci/nostd-check/rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use std::collections::{

use crate::keyexpr_tree::*;

#[cfg_attr(not(feature = "std"), allow(deprecated))]
pub struct HashMapProvider<Hash: Hasher + Default + 'static = DefaultHasher>(
core::marker::PhantomData<Hash>,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Hash: Hasher + Default + 'static = DefaultHasher>(
core::marker::PhantomData<Hash>,
);
Expand Down