CI/CD & Linting#
How the arillso repositories build, test, scan and release. The jobs themselves live as reusable workflows in arillso/.github; each repository has thin caller workflows that pass a few inputs.
Workflow Layout#
Every repository uses the same caller files under .github/workflows/:
File |
Trigger |
Purpose |
|---|---|---|
|
Pull request against |
Lint, tests, secret scan, Claude review |
|
Push to |
Re-run CI and the secret scan; the container image repository also builds and publishes here |
|
Version tag |
Release (Ansible Galaxy, GitHub Release, image) |
|
Daily cron |
Secret, code and configuration scans, SBOM |
|
Monthly cron ( |
Prune old images from the registries |
Reusable workflows are referenced by date tag, for example
arillso/.github/.github/workflows/ci-ansible-collection.yml@2026-11-20.
arillso/.github moves the tag of the current UTC day to the latest commit
on every push to main. Renovate (renovate-base preset) bumps the tag in
the consumer repositories in a weekly Monday window and automerges the update.
Ansible Collections#
Pull Request#
Excerpt from arillso/ansible.system (scenario list shortened):
jobs:
ci:
uses: arillso/.github/.github/workflows/ci-ansible-collection.yml@2026-11-20
with:
collection_namespace: arillso
collection_name: system
python_version: "3.13"
enable_unit_tests: true
enable_integration_tests: true
molecule:
uses: arillso/.github/.github/workflows/ci-ansible-molecule.yml@2026-11-20
with:
collection_namespace: arillso
collection_name: system
python_version: "3.13"
scenarios: '["access", "firewall", "packages"]'
concurrency-suffix: molecule
molecule-zram:
uses: arillso/.github/.github/workflows/ci-ansible-molecule.yml@2026-11-20
with:
collection_namespace: arillso
collection_name: system
driver: qemu
python_version: "3.13"
scenarios: '["zram"]'
concurrency-suffix: molecule-zram
ci-ansible-collection.yml runs these jobs:
Job |
What it runs |
|---|---|
Ansible Lint |
|
YAML Lint |
|
Python Lint |
|
Markdown Lint |
|
Security Scan |
Trivy filesystem scan, SARIF upload to code scanning |
Sanity Tests |
|
Unit Tests |
|
Integration Tests |
|
Argument Specs Check |
Validates |
Build Collection |
|
ci-ansible-molecule.yml runs one Molecule job per scenario:
scenarios_rootdefaults toextensions/molecule; arillso.container and arillso.agent point it atroles/<role>/moleculeinstead.driverisdockerby default. Scenarios that need a real kernel (Docker daemon, K3s, zram, tuning, a stable systemd service for Alloy) usedriver: qemuand run in a KVM guest.concurrency-suffixkeeps the nested call out of the caller’s concurrency group; without it GitHub cancels the Molecule run.
Release#
tag.yml triggers on tags matching [0-9]+.[0-9]+.[0-9]+ (no v
prefix) and calls release-ansible-collection.yml:
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
release:
uses: arillso/.github/.github/workflows/release-ansible-collection.yml@2026-11-20
with:
collection_namespace: arillso
collection_name: system
secrets:
galaxy_api_key: ${{ secrets.GALAXY_API_KEY }}
The reusable workflow:
fails if the tag differs from
versioningalaxy.yml,fails if
CHANGELOG.mdhas no non-empty## [X.Y.Z]section for the tag,builds and publishes the collection to Ansible Galaxy (
artis3n/ansible_galaxy_collection),creates a GitHub Release whose body is that changelog section.
Nightly Security#
nightly-security.yml in the collections calls:
security-secrets.yml: Gitleaks, TruffleHog and pattern detection.security-code.yml: CodeQL, languages as JSON array (for example'["python"]').security-config.yml: Trivy configuration scan; withscan-ansible: truealsoansible-lintandyamllintonansible-path.security-sbom.yml: SBOM of the repository (artifact-type: filesystem).
Jobs that upload SARIF results need security-events: write in the
caller.
Go Repositories#
go.ansible and action.playbook call ci-go.yml on pull request and
merge. It runs go mod download and go mod verify, go vet ./..., a
gofmt check, staticcheck,
go test -v -race -coverprofile=coverage.out ./... (coverage report as
artifact) and golangci-lint. The Go version comes from go.mod.
ci-lint.yml adds actionlint, shellcheck (with
enable_shellcheck: true) and yamllint. security-deps.yml runs
GitHub dependency review and a Go dependency audit.
Release tags differ between the two:
go.ansible:v[0-9]+.[0-9]+.[0-9]+and pre-releasesvX.Y.Z-<suffix>.tag.ymlbuilds and tests the module, creates the GitHub Release from the matchingCHANGELOG.mdsection and attaches an SBOM.action.playbook:[0-9]+.[0-9]+.[0-9]+without prefix.tag.ymlbuilds the action image, pushes it toghcr.io/arillso/action.playbookand creates a GitHub Release.
Container Image#
docker.ansible (image arillso/ansible) runs its own pipeline in
pull-request.yml, on pull requests and weekly (Wednesday 01:00 UTC). Code
jobs are skipped when only Markdown or LICENSE changed.
Lint:
ci-lint.ymlandhadolinton theDockerfile.Build the image once, then run against it: container-structure-test, hardening checks and Trivy (fails on fixable
CRITICAL/HIGHfindings not listed in.trivyignore), performance, integration, unit (pytest) and upgrade tests.
merge.yml runs on pushes to main that touch Dockerfile or
requirements.txt. It re-runs the pull request and security workflows, then
builds linux/amd64 and linux/arm64 images, pushes them to Docker Hub
and ghcr.io with provenance and SBOM, generates a build-provenance
attestation and creates a GitHub Release tagged with the build date.
Action Pinning#
The reusable workflows pin third-party actions to a full commit SHA with the version as comment:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Renovate updates SHA and comment together. The renovate-base preset also
updates such uses: lines inside .rst files, so examples in this guide
follow the same scheme.
Linter Configuration#
The files below are taken from arillso/ansible.system; the other
collections use the same set.
.yamllint.yml#
Excerpt:
---
extends: default
rules:
line-length:
max: 500
level: warning
indentation:
spaces: 4
indent-sequences: true
check-multi-line-strings: false
truthy:
allowed-values: ["true", "false"]
check-keys: false
document-start:
present: true
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true
.ansible-lint#
---
exclude_paths:
- .ansible/
- .github/
- .venv/
- venv/
skip_list:
- galaxy[version-incorrect]
- command-instead-of-module
- no-handler
- package-latest
warn_list:
- name[casing]
- yaml[line-length]
use_default_rules: true
The lefthook pre-commit hook runs ansible-lint --profile=production on
staged role, plugin, test and meta files.
.editorconfig#
Four spaces, LF line endings, UTF-8, final newline and trimmed trailing
whitespace for all files; trailing whitespace is kept in Markdown, and
Makefile uses tabs.
.golangci.yml#
From arillso/go.ansible, without the per-linter settings:
---
version: "2"
linters:
enable:
- errcheck
- govet
- staticcheck
- gosec
- ineffassign
- unused
- misspell
- gocritic
formatters:
enable:
- gofmt
- goimports
Local Checks#
Each repository ships a Makefile and a lefthook.yml. Run
lefthook install once after cloning. The pre-commit hook runs yamllint,
markdownlint, actionlint and Gitleaks on staged files, plus the stack’s own
checks (ansible-lint in the collections, hadolint for the image,
gofmt/go vet or golangci-lint in the Go repositories). The
pre-push hook runs a full Gitleaks scan, and go test in the Go
repositories.
make lint # collections: ansible-lint, yamllint, ruff/black
make test # collections: pytest; Go: go test
make test-molecule # collections: every Molecule scenario
make build # collections: ansible-galaxy collection build
make test in a collection runs pytest directly; CI runs
ansible-test units --docker. A green local run does not guarantee a green
CI run.
See also
Repository Standards - Repository Standards
Contributing - Contributing
Version Compatibility - Version Compatibility