use thiserror::Error; #[derive(Debug, Clone, PartialEq, Eq, Error)] pub enum ConfigError { #[error("ci config is {size} bytes, the limit is {max} bytes")] TooLarge { size: usize, max: usize }, #[error("invalid TOML: {0}")] Toml(String), #[error("no jobs are defined")] NoJobs, #[error( "{count} jobs are defined (a matrix job counts once per combination), the limit is {max}" )] TooManyJobs { count: usize, max: usize }, #[error("job {job:?}: matrix expands to {count} jobs, the limit is {max} jobs per workflow")] MatrixTooLarge { job: String, count: usize, max: usize, }, #[error("job {job:?}: invalid matrix: {reason}")] InvalidMatrix { job: String, reason: String }, #[error("invalid schedule {expr:?}: {reason}")] InvalidSchedule { expr: String, reason: String }, #[error("{count} schedules are defined, the limit is {max}")] TooManySchedules { count: usize, max: usize }, #[error("invalid job name {0:?}: must match ^[a-z0-9][a-z0-9_-]{{0,39}}$")] InvalidJobName(String), #[error("invalid workflow name {name:?}: {reason}")] InvalidWorkflowName { name: String, reason: String }, #[error("job {job:?} needs unknown job {need:?}")] UnknownNeed { job: String, need: String }, #[error("jobs form a cycle, involving job {job:?}")] Cycle { job: String }, #[error("job {job:?}: image must be non-empty and contain no whitespace")] InvalidImage { job: String }, #[error("job {job:?}: run must not be empty")] EmptyRun { job: String }, #[error("job {job:?}: invalid secret name {name:?}: must match ^[A-Z_][A-Z0-9_]{{0,63}}$")] InvalidSecretName { job: String, name: String }, #[error("job {job:?}: invalid env name {name:?}: must match ^[A-Z_][A-Z0-9_]{{0,63}}$")] InvalidEnvName { job: String, name: String }, #[error("job {job:?}: invalid artifact pattern {pattern:?}: {reason}")] InvalidArtifactGlob { job: String, pattern: String, reason: String, }, #[error("job {job:?}: invalid runner label {label:?}")] InvalidRunsOn { job: String, label: String }, #[error("job {job:?}: timeout_minutes must be between 1 and 360, got {value}")] InvalidTimeout { job: String, value: u32 }, #[error("job {job:?}: memory must be between 64m and 1024g, got {value}")] InvalidMemory { job: String, value: String }, #[error("job {job:?}: invalid cache path {path:?}: {reason}")] InvalidCachePath { job: String, path: String, reason: String, }, #[error("job {job:?}: cache lists {count} entries, the limit is {max}")] TooManyCacheEntries { job: String, count: usize, max: usize, }, #[error("job {job:?}: duplicate cache path {path:?}")] DuplicateCachePath { job: String, path: String }, #[error("[release] needs at least one tag glob in [on] tags")] ReleaseWithoutTags, #[error("[release] lists {count} assets, the limit is {max}")] TooManyReleaseAssets { count: usize, max: usize }, #[error("invalid release asset {asset:?}: {reason}")] InvalidReleaseAsset { asset: String, reason: String }, #[error("invalid release title: {0}")] InvalidReleaseTitle(String), #[error("invalid {kind} glob {pattern:?}: {reason}")] InvalidTriggerGlob { kind: &'static str, pattern: String, reason: String, }, }