misc(ci): detect gha build

This commit is contained in:
Morgan Funtowicz 2025-01-09 22:17:22 +01:00
parent 75b9d82555
commit 7a893af88b
2 changed files with 3 additions and 2 deletions

View File

@ -103,6 +103,7 @@ ENV USE_LLD_LINKER=ON
ENV CUDA_ARCH_LIST=${cuda_arch_list} ENV CUDA_ARCH_LIST=${cuda_arch_list}
ENV CMAKE_CXX_COMPILER_LAUNCHER=sccache ENV CMAKE_CXX_COMPILER_LAUNCHER=sccache
ENV RUSTC_WRAPPER=sccache ENV RUSTC_WRAPPER=sccache
ENV IS_GHA_BUILD=${is_gha_build}
COPY Cargo.lock Cargo.lock COPY Cargo.lock Cargo.lock
COPY Cargo.toml Cargo.toml COPY Cargo.toml Cargo.toml

View File

@ -113,7 +113,7 @@ fn build_backend(is_debug: bool, opt_level: &str, out_dir: &PathBuf) -> (PathBuf
) )
.define("TGI_TRTLLM_BACKEND_TRT_ROOT", tensorrt_path); .define("TGI_TRTLLM_BACKEND_TRT_ROOT", tensorrt_path);
if is_debug { if is_debug || *IS_GHA_BUILD {
config.define("TGI_TRTLLM_BACKEND_BUILD_TESTS", "ON"); config.define("TGI_TRTLLM_BACKEND_BUILD_TESTS", "ON");
} }
@ -209,7 +209,7 @@ fn build_ffi_layer(deps_folder: &PathBuf, is_debug: bool) {
fn main() { fn main() {
// Misc variables // Misc variables
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
let build_profile = env::var("PROFILE").unwrap(); let build_profile = env::var("DEBUG").unwrap();
let (is_debug, opt_level) = match build_profile.as_ref() { let (is_debug, opt_level) = match build_profile.as_ref() {
"debug" => (true, "0"), "debug" => (true, "0"),
"dev" => (true, "0"), "dev" => (true, "0"),