File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1294,7 +1294,7 @@ impl Config {
12941294
12951295 // CI should always run stage 2 builds, unless it specifically states otherwise
12961296 #[ cfg( not( test) ) ]
1297- if flags. stage . is_none ( ) && crate :: CiEnv :: current ( ) != crate :: CiEnv :: None {
1297+ if flags. stage . is_none ( ) && crate :: CiEnv :: is_rust_lang_ci ( ) {
12981298 match config. cmd {
12991299 Subcommand :: Test { .. }
13001300 | Subcommand :: Doc { .. }
Original file line number Diff line number Diff line change @@ -264,6 +264,21 @@ impl CiEnv {
264264 Self :: current ( ) != CiEnv :: None
265265 }
266266
267+ pub fn is_rust_lang_ci ( ) -> bool {
268+ if let Ok ( rust_lang_ci) = env:: var ( "RUST_LANG_CI" ) {
269+ match rust_lang_ci. as_str ( ) {
270+ "1" | "true" | "yes" | "on" => true ,
271+ "0" | "false" | "no" | "off" => false ,
272+ other => {
273+ // Let's make sure typos don't go unnoticed
274+ panic ! ( "Unrecognized option '{}' set in RUST_LANG_CI" , other)
275+ }
276+ }
277+ } else {
278+ Self :: is_ci ( )
279+ }
280+ }
281+
267282 /// If in a CI environment, forces the command to run with colors.
268283 pub fn force_coloring_in_ci ( self , cmd : & mut Command ) {
269284 if self != CiEnv :: None {
You can’t perform that action at this time.
0 commit comments