fix(ci): fix tests

This commit is contained in:
2026-07-23 16:11:27 +08:00
parent 75eace9d73
commit 574ba8b6d0
6 changed files with 141 additions and 48 deletions

View File

@@ -92,10 +92,33 @@ pub fn parse_project_name(toml: &str) -> String {
}
#[allow(dead_code)]
pub fn default_artifact_path(project_root: &Path, project_name: &str) -> PathBuf {
project_root
.join("target")
.join("x86_64-unknown-linux-gnu")
.join("debug")
.join(project_name)
pub fn host_profile_dir(project_root: &Path, profile: &str) -> PathBuf {
let target = project_root.join("target");
if cfg!(target_os = "linux") {
let arch = std::env::consts::ARCH;
let env = if cfg!(target_env = "musl") {
"musl"
} else {
"gnu"
};
target
.join(format!("{arch}-unknown-linux-{env}"))
.join(profile)
} else if cfg!(any(
target_os = "freebsd",
target_os = "openbsd",
target_os = "netbsd",
target_os = "dragonfly"
)) {
let arch = std::env::consts::ARCH;
let os = std::env::consts::OS;
target.join(format!("{arch}-unknown-{os}")).join(profile)
} else {
target.join(profile)
}
}
#[allow(dead_code)]
pub fn default_artifact_path(project_root: &Path, project_name: &str) -> PathBuf {
host_profile_dir(project_root, "debug").join(project_name)
}