3562f6f771
---ci--- project: acdl phase: 36 milestone: v1.8 status: execute ---/ci--- - schemas/README.md: how to write schemas, wire into platform, test in CI, dependencies, existing catalog, adding a new schema. - pipelines/README.md: how to write pipeline contracts, wire into workflows, test, dependencies, existing catalog, adding a new pipeline. - adapters/README.md: how to write adapters (Terraform + policy patterns), wire into platform, test, dependencies, existing catalog, adding a new adapter. - tests/test_docs_coverage.py: 6 tests validating all 3 READMEs exist with required sections. Tests: +6 (344 -> 350). All pass.
2.7 KiB
2.7 KiB
ACDL Pipelines
Overview
ACDL uses declarative pipeline contracts (YAML) as the single source of truth. Both Gitea and GitHub workflows implement the same contract (byte-identical). The shell runner (scripts/run_ci.sh) mirrors the CI pipeline locally so that every stage that runs in CI can be reproduced on a developer machine without a forge.
Existing Pipelines
| Pipeline | File | Stages | Triggers |
|---|---|---|---|
| ACDL CI | ci.yaml |
lint, test, check-only |
push/PR to main |
| ACDL Deploy | deploy.yaml |
validate-contract, resolve-stack, terraform-plan, checkov, confidence, apply, publish-outputs, deploy-uptime, comment-outputs |
push/PR to main (consumer repos via workflow_call) |
How to Write a Pipeline
- YAML structure:
name,environment,triggers(withpushandpull_requestbranch arrays),runner,python_version, and astages[]list. - Each stage is an object with
name,command,required(boolean), and optionalinstall(pip install command) +description(human-readable summary). - Validate the resulting YAML against
schemas/pipeline.schema.json(CI) orschemas/deploy-pipeline.schema.json(deploy).
How to Wire a Pipeline
- Create byte-identical workflow YAMLs in
.gitea/workflows/<name>.ymland.github/workflows/<name>.yml. - Both workflows must implement the same stages, commands, triggers, and runner declared in the contract.
scripts/run_ci.shmirrorsci.yamllocally so the same stages run without a forge.- Consumer repos reference the deploy pipeline via
uses: acdl/.github/workflows/deploy.yml@vX.Y.
Dependencies
scripts/run_ci.sh— local CI mirror that runs theci.yamlstages.scripts/run_platform.sh— platform pipeline runner that implements thedeploy.yamlstages.- Workflow YAMLs in
.gitea/workflows/and.github/workflows/. - Schemas in
schemas/(pipeline.schema.json,deploy-pipeline.schema.json).
How to Test Pipelines
tests/test_pipeline_contract.py— validates each pipeline YAML against its schema, asserts workflow conformance (byte-identical Gitea/GitHub workflows with the same stages/commands/triggers), and testsscripts/run_ci.shexecution against the contract.
Adding a New Pipeline
- Create
pipelines/<name>.yamlusing the structure above. - Create or extend the schema in
schemas/for the new pipeline shape. - Create byte-identical workflow YAMLs in
.gitea/workflows/<name>.ymland.github/workflows/<name>.yml. - Extend
scripts/run_ci.shif a local mirror of the new pipeline is needed. - Write or extend tests in
tests/test_pipeline_contract.pyto assert schema validity and workflow conformance.