Skip to content

Commit

Permalink
identify several other CI systems - #48 and #60
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Apr 6, 2024
1 parent cae5b0b commit ceb20f3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,23 @@ use regex::Regex;
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone)]
#[allow(clippy::struct_excessive_bools)]
pub struct Details {
#[serde(default = "default_false")]
pub has_github_action: bool,
#[serde(default = "default_false")]
pub has_gitlab_pipeline: bool,
#[serde(default = "default_false")]
pub has_circle_ci: bool,
#[serde(default = "default_false")]
pub has_cirrus_ci: bool,
#[serde(default = "default_false")]
pub has_travis_ci: bool,
#[serde(default = "default_false")]
pub has_jenkins: bool,
#[serde(default = "default_false")]
pub has_appveyor: bool,
#[serde(default = "default_false")]
pub has_azure_pipeline: bool,

pub commit_count: i32,
pub cargo_toml_in_root: bool,
pub cargo_fmt: String,
Expand All @@ -37,6 +52,13 @@ impl Details {
Self {
has_github_action: false,
has_gitlab_pipeline: false,
has_circle_ci: false,
has_cirrus_ci: false,
has_travis_ci: false,
has_jenkins: false,
has_appveyor: false,
has_azure_pipeline: false,

commit_count: 0,
cargo_toml_in_root: false,
cargo_fmt: String::new(),
Expand Down
7 changes: 7 additions & 0 deletions src/vcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ fn collect_data_about_ci(host: &String, details: &mut Details) {
let gitlab_ci_file = Path::new(".gitlab-ci.yml");
details.has_gitlab_pipeline = gitlab_ci_file.exists();
}
details.has_circle_ci = Path::new(".circleci").exists();
details.has_cirrus_ci = Path::new(".cirrus.yaml").exists();
details.has_travis_ci = Path::new(".travis.yaml").exists();
details.has_jenkins = Path::new("Jenkinsfile").exists();
details.has_appveyor =
Path::new(".appveyor.yml").exists() || Path::new("appveyor.yml").exists();
details.has_azure_pipeline = Path::new("azure-pipelines.yml").exists();
}

fn process_cargo_toml(details: &mut Details) {
Expand Down

0 comments on commit ceb20f3

Please sign in to comment.