Skip to content

Commit a32f7c5

Browse files
committed
add support for compile-time if/if-not CI check
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent c31cccb commit a32f7c5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bootstrap/build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@ fn main() {
44
let host = env::var("HOST").unwrap();
55
println!("cargo:rerun-if-changed=build.rs");
66
println!("cargo:rustc-env=BUILD_TRIPLE={host}");
7+
8+
println!("cargo::rerun-if-env-changed=GITHUB_ACTIONS");
9+
println!("cargo::rustc-check-cfg=cfg(ci)");
10+
if env::var("GITHUB_ACTIONS").is_ok() {
11+
println!("cargo:rustc-cfg=ci");
12+
}
713
}

0 commit comments

Comments
 (0)