#[cfg(test)]
#[path = "./types_test.rs"]
mod types_test;
#[cfg_attr(feature = "serde-1", derive(Serialize, Deserialize))]
#[derive(Debug, Clone, PartialEq, Copy)]
#[non_exhaustive]
pub enum Vendor {
Agola,
AppCenter,
AppCircle,
AppVeyor,
AWSCodeBuild,
AzurePipelines,
Bamboo,
BitbucketPipelines,
Bitrise,
Buddy,
Buildkite,
CircleCI,
CirrusCI,
Codefresh,
Codemagic,
Codeship,
Drone,
DSARI,
FlowCI,
GitLabCI,
GitHubActions,
Gerrit,
GoCD,
GoogleCloudBuild,
HarnessCI,
Heroku,
Hudson,
Jenkins,
JenkinsX,
LayerCI,
MagnumCI,
NetlifyCI,
Nevercode,
Prow,
Render,
SailCI,
Screwdriver,
Semaphore,
Shippable,
SolanoCI,
SourceHut,
StriderCD,
TaskCluster,
TeamCity,
TravisCI,
Vela,
Vercel,
WoodpeckerCI,
XcodeCloud,
XcodeServer,
Unknown,
}
#[derive(Debug, Clone)]
pub(crate) enum EnvValue {
Exists(String),
AllExists(Vec<String>),
AnyExists(Vec<String>),
Value(String, String),
NotEqual(String, String),
Contains(String, String),
NotEmpty(String),
}
#[derive(Debug, Clone)]
pub(crate) struct VendorConfig {
pub(crate) name: String,
pub(crate) vendor: Vendor,
pub(crate) ci_env: EnvValue,
pub(crate) pr_env: Option<EnvValue>,
pub(crate) branch_name_env: Option<String>,
}
#[cfg_attr(feature = "serde-1", derive(Serialize, Deserialize))]
#[derive(Debug, Clone, PartialEq, Default)]
pub struct CiInfo {
pub vendor: Option<Vendor>,
pub name: Option<String>,
pub ci: bool,
pub pr: Option<bool>,
pub branch_name: Option<String>,
}
impl CiInfo {
pub fn new() -> CiInfo {
Default::default()
}
}