Skip to content

Commit

Permalink
Source cargo env before each Rust command
Browse files Browse the repository at this point in the history
  • Loading branch information
oteffahi committed Apr 18, 2024
1 parent a6cc8e4 commit 6bc567b
Showing 1 changed file with 32 additions and 16 deletions.
48 changes: 32 additions & 16 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6bc567b

Please sign in to comment.