Consolidate required CI gate (#115)
Some checks failed
CI / required (push) Failing after 3m35s
Some checks failed
CI / required (push) Failing after 3m35s
This commit is contained in:
@@ -13,6 +13,7 @@ use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
mod api_surface;
|
||||
mod artifact;
|
||||
mod ci_gate;
|
||||
mod dependency;
|
||||
mod documentation;
|
||||
mod provenance;
|
||||
@@ -20,13 +21,14 @@ mod release_candidate;
|
||||
|
||||
pub use api_surface::{audit_api_surface, write_api_baseline};
|
||||
pub use artifact::audit_artifacts;
|
||||
pub use ci_gate::{audit_consolidated_ci, run_release_gate, run_required_gate};
|
||||
pub use dependency::audit_dependencies;
|
||||
pub use documentation::{audit_documentation, write_documentation_report};
|
||||
pub use provenance::{audit_provenance, write_provenance_reports};
|
||||
pub use release_candidate::audit_release_candidate;
|
||||
|
||||
pub const MATRIX_PATH: &str = "ci/release-matrix.json";
|
||||
const WORKFLOW_PATH: &str = ".gitea/workflows/release-matrix.yml";
|
||||
const WORKFLOW_PATH: &str = ".gitea/workflows/release.yml";
|
||||
const REQUIRED_PROFILES: [&str; 7] = [
|
||||
"linux-msrv-portable",
|
||||
"linux-stable-default",
|
||||
@@ -458,25 +460,16 @@ fn audit_cargo_features(root: &Path) -> Result<()> {
|
||||
|
||||
fn audit_workflows(root: &Path, matrix: &ReleaseMatrix) -> Result<()> {
|
||||
let workflow = fs::read_to_string(root.join(WORKFLOW_PATH))?;
|
||||
for profile in &matrix.profiles {
|
||||
if !workflow.contains(&format!("profile: {}", profile.id)) {
|
||||
return Err(MatrixError::new(format!(
|
||||
"workflow does not schedule profile {}",
|
||||
profile.id
|
||||
)));
|
||||
}
|
||||
}
|
||||
if !workflow.contains("~/.cargo/registry")
|
||||
if matrix.profiles.is_empty()
|
||||
|| !workflow.contains("release-gate")
|
||||
|| !workflow.contains("~/.cargo/registry")
|
||||
|| !workflow.contains("~/.cargo/git")
|
||||
|| workflow.lines().any(|line| {
|
||||
let trimmed = line.trim();
|
||||
trimmed == "target" || trimmed.starts_with("target/") || trimmed.contains("/target/")
|
||||
})
|
||||
{
|
||||
return Err(MatrixError::new(
|
||||
"workflow must cache Cargo downloads without caching build target directories",
|
||||
"release workflow must invoke the Rust gate and cache Cargo downloads",
|
||||
));
|
||||
}
|
||||
audit_consolidated_ci(root)?;
|
||||
let workflows = root.join(".gitea/workflows");
|
||||
for entry in fs::read_dir(workflows)? {
|
||||
let path = entry?.path();
|
||||
|
||||
Reference in New Issue
Block a user