diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index d710ebf756..09aa254a85 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -86,32 +86,42 @@ jobs: run: apt-get update && apt-get install -y curl git build-essential - name: Install Rust toolchain - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - . "$HOME/.cargo/env" + run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - name: Clone this repository uses: actions/checkout@v4 - name: Add Zenoh Rust toolchain version - run: rustup override set $(cat rust-toolchain.toml | grep '^channel' | sed 's/[^"]*"//' | sed 's/"//') + run: | + . "$HOME/.cargo/env" + rustup override set $(cat rust-toolchain.toml | grep '^channel' | sed 's/[^"]*"//' | sed 's/"//') - name: Install rustup components - run: rustup component add rustfmt clippy + run: | + . "$HOME/.cargo/env" + rustup component add rustfmt clippy - name: Code format check - run: cargo fmt --check + run: | + . "$HOME/.cargo/env" + cargo fmt --check env: CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse - name: Clippy check - run: cargo +stable clippy --all-targets --features=${{ inputs.features }} -- --deny warnings + run: | + . "$HOME/.cargo/env" + cargo +stable clippy --all-targets --features=${{ inputs.features }} -- --deny warnings - name: Clippy unstable check - run: cargo +stable clippy --all-targets -- --deny warnings + run: | + . "$HOME/.cargo/env" + cargo +stable clippy --all-targets -- --deny warnings - name: Clippy all features - run: cargo +stable clippy --all-targets --all-features -- --deny warnings + run: | + . "$HOME/.cargo/env" + cargo +stable clippy --all-targets --all-features -- --deny warnings tests-ubuntu-24: name: Tests on Ubuntu 24.04 @@ -123,29 +133,35 @@ jobs: run: apt-get update && apt-get install -y curl git build-essential - name: Install Rust toolchain - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - . "$HOME/.cargo/env" + run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - name: Clone this repository uses: actions/checkout@v4 - name: Add Zenoh Rust toolchain version - run: rustup override set $(cat rust-toolchain.toml | grep '^channel' | sed 's/[^"]*"//' | sed 's/"//') + run: | + . "$HOME/.cargo/env" + rustup override set $(cat rust-toolchain.toml | grep '^channel' | sed 's/[^"]*"//' | sed 's/"//') - name: Install nextest - run: cargo +stable install --locked cargo-nextest + run: | + . "$HOME/.cargo/env" + cargo +stable install --locked cargo-nextest env: CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse - name: Run tests - run: cargo nextest run --release --features=${{ inputs.features }} --verbose + run: | + . "$HOME/.cargo/env" + cargo nextest run --release --features=${{ inputs.features }} --verbose env: CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse ASYNC_STD_THREAD_COUNT: 4 - name: Run doctests - run: cargo test --release --features=${{ inputs.features }} --doc + run: | + . "$HOME/.cargo/env" + cargo test --release --features=${{ inputs.features }} --doc env: CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse ASYNC_STD_THREAD_COUNT: 4