Skip to content

Commit c154c8d

Browse files
committed
Disable automatic self updates in CI environments
1 parent 4c3ff9c commit c154c8d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ci/run.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,5 @@ build_test() {
7777
if [ -z "$SKIP_TESTS" ]; then
7878
target_cargo run --features test -- --dump-testament
7979
build_test build
80-
build_test test
80+
RUSTUP_CI=1 build_test test
8181
fi

src/config.rs

+6
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,12 @@ impl<'a> Cfg<'a> {
418418
}
419419

420420
pub(crate) fn get_self_update_mode(&self) -> Result<SelfUpdateMode> {
421+
if self.process.var("CI").is_ok() {
422+
if !self.process.var("RUSTUP_CI").is_ok() {
423+
return Ok(SelfUpdateMode::Disable);
424+
}
425+
}
426+
421427
self.settings_file.with(|s| {
422428
Ok(match s.auto_self_update {
423429
Some(mode) => mode,

0 commit comments

Comments
 (0)