012: CI/CD and Tooling¶
- Type: Operational
- Status: Accepted
- Date: 2026-12-02
- Author(s) / Deciders: João V. Farias
- Question: What formatting tools, static analysis gates, CI workflows, and release pipelines enforce repository standards?
Context¶
Consistent automated checks prevent formatting drift, compiler warnings, broken documentation links, and unverified release archives from merging into master. Rust code and Zensical documentation run the same checks locally and in GitHub Actions.
Static analysis and code formatting¶
Repository checks enforce uniform formatting and zero-warning compilation across every Rust target and documentation file:
rustfmtvalidates all Rust source files viacargo fmt --all -- --checkwith default project formatting rules.- Markdown documentation follows 003: Writing Style and builds cleanly via
zensical build --cleaninsidedocumentation/. clippyruns in strict mode across library, binary, and test crates viacargo clippy --all-targets -- -D warnings, paired withunsafe_code = "forbid"inCargo.toml.
CI quality gate pipeline¶
GitHub Actions (.github/workflows/ci.yml) executes two jobs (validate-docs and validate-code) on pushes and pull requests targeting master or main:
flowchart LR
Fmt["1. cargo fmt --check"] --> Clippy["2. cargo clippy -D warnings"]
Clippy --> Test["3. cargo test --all-targets"]
Test --> Build["4. cargo build --release"]
Build --> Docs["5. zensical build --clean"]
The five verification stages run these checks:
- Format checking ensures all Rust files match
rustfmtwith no diffs. - Static analysis rejects any
rustcorclippywarning across library and test targets. - Automated tests execute unit and integration suites (
cargo test --all-targets). - Release builds compile the optimized binary (
cargo build --release). - Documentation checks regenerate metrics snippets via
.github/scripts/update_metrics.pyand runzensical build --clean.
Release and deployment workflows¶
Three additional workflows under .github/workflows/ automate binary packaging, site publishing, and project metrics:
- Tagging a release (
v*) triggers.github/workflows/release.yml, which compiles optimized binaries forx86_64-unknown-linux-gnuand staticx86_64-unknown-linux-musl. It packages each binary withLICENSE,COPYING.EXCEPTION, andREADME.mdinto.tar.gzarchives alongside.sha256files andSHA256SUMS.txton GitHub Releases. - Pushing to
masterormaintriggers.github/workflows/docs.yml, regenerating metrics snippets and deployingdocumentation/siteto GitHub Pages. - Pushing non-metrics changes to
masterormain(or manual dispatch) triggers.github/workflows/metrics.ymlto commit updated Mermaid snippets underdocumentation/snippets/management/.
Local workflow parity¶
Developers and coding agents run identical checks locally via .vscode/tasks.json or direct shell commands (cargo fmt --all -- --check && cargo clippy --all-targets -- -D warnings && cargo test --all-targets and cd documentation && zensical build --clean). Every commit follows Conventional Commits on master.
Alternatives¶
Running CI checks without building distributable release tarballs would keep workflows simpler, yet forces Linux users without a Rust toolchain to compile winesmith from source. Adding crates.io or AUR auto-publishing upfront adds external credential overhead before the first v0.1.0 tag stabilizes, so those channels wait until after v1.
Decision¶
Enforce strict zero-warning Rust and Zensical checks in .github/workflows/ci.yml, deploy documentation via docs.yml, refresh repository charts via metrics.yml, and publish x86_64 gnu and static musl archives with SHA-256 checksums via .github/workflows/release.yml on v* tags.
Consequences¶
Positives¶
Every commit on master compiles formatted, lint-clean code alongside warning-free static documentation. Linux users can download verified static binaries directly from GitHub Releases without installing Cargo.
Negatives¶
Maintaining static x86_64-unknown-linux-musl builds constrains dependencies to pure-Rust TLS (rustls) and pure-Rust archive crates rather than dynamically linked C libraries.