forge
Clone
https://git.tahinli.com/Tahinli/forge.git
0 watching·0 forks·Rust·AGPL-3.0·9.7 MiB·37e985d·Tahinli·3 hours ago·363 commits
| 1 | use thiserror::Error; |
| 2 | |
| 3 | #[derive(Debug, Clone, PartialEq, Eq, Error)] |
| 4 | pub enum ConfigError { |
| 5 | #[error("ci config is {size} bytes, the limit is {max} bytes")] |
| 6 | TooLarge { size: usize, max: usize }, |
| 7 | |
| 8 | #[error("invalid TOML: {0}")] |
| 9 | Toml(String), |
| 10 | |
| 11 | #[error("no jobs are defined")] |
| 12 | NoJobs, |
| 13 | |
| 14 | #[error( |
| 15 | "{count} jobs are defined (a matrix job counts once per combination), the limit is {max}" |
| 16 | )] |
| 17 | TooManyJobs { count: usize, max: usize }, |
| 18 | |
| 19 | #[error("job {job:?}: matrix expands to {count} jobs, the limit is {max} jobs per workflow")] |
| 20 | MatrixTooLarge { |
| 21 | job: String, |
| 22 | count: usize, |
| 23 | max: usize, |
| 24 | }, |
| 25 | |
| 26 | #[error("job {job:?}: invalid matrix: {reason}")] |
| 27 | InvalidMatrix { job: String, reason: String }, |
| 28 | |
| 29 | #[error("invalid schedule {expr:?}: {reason}")] |
| 30 | InvalidSchedule { expr: String, reason: String }, |
| 31 | |
| 32 | #[error("{count} schedules are defined, the limit is {max}")] |
| 33 | TooManySchedules { count: usize, max: usize }, |
| 34 | |
| 35 | #[error("invalid job name {0:?}: must match ^[a-z0-9][a-z0-9_-]{{0,39}}$")] |
| 36 | InvalidJobName(String), |
| 37 | |
| 38 | #[error("invalid workflow name {name:?}: {reason}")] |
| 39 | InvalidWorkflowName { name: String, reason: String }, |
| 40 | |
| 41 | #[error("job {job:?} needs unknown job {need:?}")] |
| 42 | UnknownNeed { job: String, need: String }, |
| 43 | |
| 44 | #[error("jobs form a cycle, involving job {job:?}")] |
| 45 | Cycle { job: String }, |
| 46 | |
| 47 | #[error("job {job:?}: image must be non-empty and contain no whitespace")] |
| 48 | InvalidImage { job: String }, |
| 49 | |
| 50 | #[error("job {job:?}: run must not be empty")] |
| 51 | EmptyRun { job: String }, |
| 52 | |
| 53 | #[error("job {job:?}: invalid secret name {name:?}: must match ^[A-Z_][A-Z0-9_]{{0,63}}$")] |
| 54 | InvalidSecretName { job: String, name: String }, |
| 55 | |
| 56 | #[error("job {job:?}: invalid env name {name:?}: must match ^[A-Z_][A-Z0-9_]{{0,63}}$")] |
| 57 | InvalidEnvName { job: String, name: String }, |
| 58 | |
| 59 | #[error("job {job:?}: invalid artifact pattern {pattern:?}: {reason}")] |
| 60 | InvalidArtifactGlob { |
| 61 | job: String, |
| 62 | pattern: String, |
| 63 | reason: String, |
| 64 | }, |
| 65 | |
| 66 | #[error("job {job:?}: invalid runner label {label:?}")] |
| 67 | InvalidRunsOn { job: String, label: String }, |
| 68 | |
| 69 | #[error("job {job:?}: timeout_minutes must be between 1 and 360, got {value}")] |
| 70 | InvalidTimeout { job: String, value: u32 }, |
| 71 | |
| 72 | #[error("job {job:?}: memory must be between 64m and 1024g, got {value}")] |
| 73 | InvalidMemory { job: String, value: String }, |
| 74 | |
| 75 | #[error("job {job:?}: invalid cache path {path:?}: {reason}")] |
| 76 | InvalidCachePath { |
| 77 | job: String, |
| 78 | path: String, |
| 79 | reason: String, |
| 80 | }, |
| 81 | |
| 82 | #[error("job {job:?}: cache lists {count} entries, the limit is {max}")] |
| 83 | TooManyCacheEntries { |
| 84 | job: String, |
| 85 | count: usize, |
| 86 | max: usize, |
| 87 | }, |
| 88 | |
| 89 | #[error("job {job:?}: duplicate cache path {path:?}")] |
| 90 | DuplicateCachePath { job: String, path: String }, |
| 91 | |
| 92 | #[error("[release] needs at least one tag glob in [on] tags")] |
| 93 | ReleaseWithoutTags, |
| 94 | |
| 95 | #[error("[release] lists {count} assets, the limit is {max}")] |
| 96 | TooManyReleaseAssets { count: usize, max: usize }, |
| 97 | |
| 98 | #[error("invalid release asset {asset:?}: {reason}")] |
| 99 | InvalidReleaseAsset { asset: String, reason: String }, |
| 100 | |
| 101 | #[error("invalid release title: {0}")] |
| 102 | InvalidReleaseTitle(String), |
| 103 | |
| 104 | #[error("invalid {kind} glob {pattern:?}: {reason}")] |
| 105 | InvalidTriggerGlob { |
| 106 | kind: &'static str, |
| 107 | pattern: String, |
| 108 | reason: String, |
| 109 | }, |
| 110 | } |