You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,26 @@
1
1
# CIGen
2
2
3
-
CIGen makes your CI configuration files more maintainable and has many built-in power features to make them more efficient. Especially beneficial for monorepos.
3
+
CIGen generates CI configuration from a small set of reusable, provider-agnostic files. It currently targets CircleCI and focuses on correctness, validation, and convention-over-configuration.
4
4
5
-
This tool can be used to build both static config and [dynamic config for CircleCI](https://circleci.com/docs/dynamic-config/). The CLI includes a file hashing feature that can be used during the initial setup workflow to skip jobs when no files have changed.r
5
+
The tool can generate both static CircleCI configs and setup/dynamic configs. The CLI includes utilities for validation, graph visualization, and template-based multi-output generation.
6
6
7
-
## Features
7
+
## Features (Current)
8
8
9
-
- Supports CircleCI and GitHub Actions (soon)
10
-
- Written in Rust for performance and reliability
11
-
- Caching and intelligent job skipping as a core feature with configurable cache backends
12
-
- Built-in defaults for many languages and package managers (completely configurable)
13
-
- First-class support for running jobs on multiple architectures and self-hosted runners
14
-
- Automatic git checkout with extra caching support for self-hosted runners
15
-
- Automatic job dependencies with cache restoration
- Generating CI pipeline configurations from reusable templates
32
-
- Integrating with Nx monorepo tooling to understand project dependencies
33
-
- Supporting multiple CI providers (starting with CircleCI)
34
-
- Providing plugin-based architecture for cache backends and CI providers
38
+
- Validating configuration (schema + data-level) with helpful spans
39
+
- Emitting native CircleCI 2.1 YAML, including workflows, jobs, and commands
35
40
36
41
## Philosophy
37
42
@@ -41,9 +46,9 @@ We had built our own internal CI config generation system in Ruby, but it had st
41
46
42
47
We automatically add a highly-optimized git checkout step to the beginning of each job, which includes caching for remote runners. The git checkout step can be skipped for jobs that don't need it.
43
48
44
-
#### Jobs should be skipped if nothing has changed
49
+
#### Job skipping
45
50
46
-
Most CI providers only support caching as a second-class feature - something you add as a "step" during your job. `cigen` makes caching an integral part of your CI config. Every job MUST provide a list of file patterns. If none of those files have changed, the job is skipped and the existing cache is used. We inject all of the caching steps automatically.
51
+
The codebase contains an initial scaffold for job skipping using a source-file hash and a local marker file. This is experimental and not yet wired to a persistent cache backend, so it does not skip across separate runs. A robust, persistent job-status cache is planned.
47
52
48
53
#### Cross-platform CI config
49
54
@@ -53,7 +58,7 @@ CI providers often solve the same problem in different ways. e.g. to avoid dupli
53
58
54
59
#### You can still use native CI provider features
55
60
56
-
You can still write a step that uses GitHub's "Actions" or CircleCI's "orbs". (We'll just raise a validation error if you try to use an "orb" on GitHub actions.)
61
+
You can still use native CircleCI features (e.g., orbs). Other providers will come later; unsupported features are validated with clear errors.
57
62
58
63
---
59
64
@@ -68,7 +73,7 @@ cd cigen
68
73
69
74
Prerequisites:
70
75
71
-
- Rust (will automatically use 1.88.0 via`rust-toolchain.toml`)
76
+
- Rust (uses the version pinned in`rust-toolchain.toml`)
72
77
- Git
73
78
74
79
1.**Run the setup script** (installs git hooks and checks your environment):
Copy file name to clipboardExpand all lines: docs/src/content/docs/advanced/job-skipping.mdx
+15-42Lines changed: 15 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,21 +11,19 @@ import {
11
11
Card,
12
12
} from'@astrojs/starlight/components';
13
13
14
-
Cigen's job skipping system automatically skips jobs when their source files haven't changed since the last successful run. This is the core efficiency feature that eliminates unnecessary work in CI pipelines while maintaining correctness.
14
+
Cigen contains an initial scaffold for job skipping based on a hash of source files. This is experimental: the current implementation writes a local marker file and is not yet backed by a persistent cache, so it does not skip across separate CI runs.
15
15
16
16
## How It Works
17
17
18
18
<Steps>
19
-
20
-
1.**Pre-execution**: Calculate SHA-256 hash of all source files
21
-
2.**Skip check**: If cache marker exists for this hash, skip the job entirely
22
-
3.**Post-execution**: On successful completion, record the hash in skip cache
23
-
19
+
1. Calculate SHA-256 hash of configured source files
20
+
2. Check for a local skip marker file for that hash
21
+
3. If present, halt remaining steps (CircleCI)
22
+
4. Otherwise, run the job and write the marker file at the end
24
23
</Steps>
25
24
26
25
<Asidetype="tip">
27
-
Job skipping only occurs after successful completion - failed jobs never
28
-
create skip markers, ensuring reliability.
26
+
This is non-persistent. Markers live under `/tmp` in the job container and are not restored across runs yet.
29
27
</Aside>
30
28
31
29
## Source File Configuration
@@ -110,13 +108,11 @@ Job skipping is architecture-aware:
110
108
title="Architecture-aware skipping"
111
109
/>
112
110
113
-
Generates separate skip cache entries:
111
+
Writes separate marker files per architecture under `/tmp/cigen_skip_cache/`, for example:
114
112
115
113
-`/tmp/cigen_skip_cache/job_{hash}_amd64`
116
114
-`/tmp/cigen_skip_cache/job_{hash}_arm64`
117
115
118
-
Each architecture can skip independently based on completion status.
119
-
120
116
## Generated Implementation
121
117
122
118
### Hash Calculation
@@ -171,37 +167,14 @@ Each architecture can skip independently based on completion status.
171
167
title="Success recording"
172
168
/>
173
169
174
-
## Platform Implementations
175
-
176
-
<CardGrid>
177
-
<Cardtitle="CircleCI"icon="seti:config">
178
-
Uses `circleci step halt` to skip remaining steps in job
179
-
</Card>
180
-
<Cardtitle="GitHub Actions"icon="github">
181
-
Uses early `exit 0` with conditional step execution
182
-
</Card>
183
-
<Cardtitle="GitLab CI"icon="seti:gitlab">
184
-
Uses `exit 0` with job result caching
185
-
</Card>
186
-
</CardGrid>
187
-
188
-
## Benefits
189
-
190
-
<CardGrid>
191
-
<Cardtitle="Time Savings"icon="rocket">
192
-
Skip jobs when source files haven't changed - often 50-80% reduction in CI
193
-
time
194
-
</Card>
195
-
<Cardtitle="Cost Efficiency"icon="approve-check">
196
-
Reduce CI resource usage and costs significantly
197
-
</Card>
198
-
<Cardtitle="Faster Feedback"icon="forward">
199
-
Get results faster for unchanged components and dependencies
200
-
</Card>
201
-
<Cardtitle="Reliability"icon="star">
202
-
Only skips after successful completion - failed jobs always re-run
203
-
</Card>
204
-
</CardGrid>
170
+
## Platform Notes
171
+
172
+
- CircleCI: uses `circleci step halt` to skip remaining steps in a job
173
+
- Other providers: not yet implemented
174
+
175
+
## Status and Roadmap
176
+
177
+
This feature is incomplete without a persistent backend. A job-status cache (to restore skip markers across runs) is planned.
0 commit comments