Run cicada in CI
This guide shows you how to wire cicada into a pipeline: format checks, validation, machine-readable plans, and drift gates. All verbs exit 0/1, so shell &&/-e handling is enough.
Check formatting and validity
cicada fmt --check # exit 1 if any file isn't canonical
cicada validate # exit 1 on schema or invariant errorsfmt --check writes nothing — it reports files that would be reformatted. Run cicada fmt locally to fix.
Produce a machine-readable plan
cicada plan --provider google --out plan.jsonplan.json is a cicada/plan-v1 document (a JSON array when several calendars were planned): the ordered op list with diffs, capability findings, and a drift summary. It's a stable contract — gate deploys on it, archive it, or feed it to review tooling. plan exits non-zero when a plan carries error-severity findings, so a job can stop there.
Gate on drift
cicada drift --provider google # exit 1 when any drift existsThe non-zero exit is the signal. Typical cron-style job: run drift nightly to alert on out-of-band edits to managed calendars.
Apply unattended
cicada apply --provider google --auto-approve --notify none--auto-approveskips the[y/N]prompt (required in CI).--notify nonesuppresses attendee emails for churn-heavy runs (externalOnlyis the YAML/default policy).- Exit
1means at least one op failed — check the per-op lines (✗ create …) and the journal for error kinds;transientfailures are safe to retry with--resume.
Credentials in CI
Prefer service-account auth — no interactive flow:
env:
CICADA_GOOGLE_SERVICE_ACCOUNT_JSON: ${{ runner.temp }}/sa.json
steps:
- run: echo "$SA_KEY_JSON" > "$CICADA_GOOGLE_SERVICE_ACCOUNT_JSON"Or store the key once per runner via cicada provider add google --service-account key.json. See Connect Google Calendar and the providers reference.
Example: validate + drift gate
- run: cargo xtask install # or fetch a prebuilt cicada binary
- run: cicada fmt --check
- run: cicada validate
- run: cicada drift --provider google
env:
CICADA_GOOGLE_SERVICE_ACCOUNT_JSON: sa.json