Skip to content

Commit c8d3b9e

Browse files
committed
ci: preserve the installed Rust toolchain under sudo
Signed-off-by: faratech <35661811+faratech@users.noreply.github.com>
1 parent 73d499a commit c8d3b9e

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,16 @@ jobs:
5454
# The LSAPI supervisor suite signals and reaps detached descendants.
5555
# GitHub's runner blocks those operations for its unprivileged user.
5656
run: |
57+
cargo_bin="$(rustup which cargo)"
58+
rustc_bin="$(rustup which rustc)"
59+
rustdoc_bin="$(rustup which rustdoc)"
5760
sudo env \
61+
"HOME=$HOME" \
62+
"CARGO_HOME=$HOME/.cargo" \
5863
"PATH=$PATH" \
59-
"RUSTUP_HOME=$RUSTUP_HOME" \
60-
"CARGO_HOME=$CARGO_HOME" \
61-
cargo test --workspace --locked
64+
"RUSTC=$rustc_bin" \
65+
"RUSTDOC=$rustdoc_bin" \
66+
"$cargo_bin" test --workspace --locked
6267
6368
dco:
6469
if: github.event_name == 'pull_request'

0 commit comments

Comments
 (0)