Add doc_url attribute to CI jobs

This commit is contained in:
Jakub Beránek 2025-03-13 14:46:35 +01:00
parent 961351c76c
commit 3cf1a68280
No known key found for this signature in database
GPG key ID: 909CD0D26483516B
3 changed files with 7 additions and 1 deletions

View file

@ -24,6 +24,8 @@ pub struct Job {
/// Free additional disk space in the job, by removing unused packages.
#[serde(default)]
pub free_disk: Option<bool>,
/// Documentation link to a resource that could help people debug this CI job.
pub doc_url: Option<String>,
}
impl Job {
@ -103,6 +105,8 @@ struct GithubActionsJob {
continue_on_error: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
free_disk: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
doc_url: Option<String>,
}
/// Skip CI jobs that are not supposed to be executed on the given `channel`.
@ -188,6 +192,7 @@ fn calculate_jobs(
env,
continue_on_error: job.continue_on_error,
free_disk: job.free_disk,
doc_url: job.doc_url,
}
})
.collect();

View file

@ -40,7 +40,7 @@ try-job: dist-i686-msvc"#,
fn pr_jobs() {
let stdout = get_matrix("pull_request", "commit", "refs/heads/pr/1234");
insta::assert_snapshot!(stdout, @r#"
jobs=[{"name":"mingw-check","full_name":"PR - mingw-check","os":"ubuntu-24.04","env":{"PR_CI_JOB":1},"free_disk":true},{"name":"mingw-check-tidy","full_name":"PR - mingw-check-tidy","os":"ubuntu-24.04","env":{"PR_CI_JOB":1},"continue_on_error":true,"free_disk":true}]
jobs=[{"name":"mingw-check","full_name":"PR - mingw-check","os":"ubuntu-24.04","env":{"PR_CI_JOB":1},"free_disk":true},{"name":"mingw-check-tidy","full_name":"PR - mingw-check-tidy","os":"ubuntu-24.04","env":{"PR_CI_JOB":1},"continue_on_error":true,"free_disk":true,"doc_url":"https://foo.bar"}]
run_type=pr
"#);
}

View file

@ -75,6 +75,7 @@ pr:
<<: *job-linux-4c
- name: mingw-check-tidy
continue_on_error: true
doc_url: https://foo.bar
<<: *job-linux-4c
# Jobs that run when you perform a try build (@bors try)