Filare CI Pipeline¶
This repository uses:
- A main CI workflow (
.github/workflows/ci.yml, named “Filare Main CI (release path)”) that runs on pushes tomain/betaand on pull requests targetingmain(release/publish path). - A beta PR CI workflow (
.github/workflows/pr-beta-ci.yml) that runs on pull requests targetingbeta(lint → tests only). - A lightweight guard workflow (
.github/workflows/pr-target-beta.yml) that enforces the beta-first flow by blocking PRs that bypassbetaor attempt to merge intomainwithout prior validation.
Branch & validation flow¶
- Default PR base is
beta; set the repository’s default branch tobetain GitHub settings so the GitHub UI/gh pr createofferbetaby default. - Beta PRs run
.github/workflows/pr-beta-ci.yml(lint, then tests). - A PR targeting
mainis allowed only when the head branch is this repository’sbetabranch and the PR carries thevalidatedlabel (added by the validation agent); it runs the full.github/workflows/ci.yml. - All other PR targets will fail the
Enforce beta as default basecheck and must be retargeted tobeta. - Ensure the repository has a
validatedlabel so the validation agent can tag thebeta→mainpromotion PR.
Jobs / Stages¶
- Lint
- Runs
black --checkonsrc/andtests/. - Runs
prettier --checkon docs and templates. -
Requires Python (3.11) and Node (for prettier).
-
Tests
- Installs graphviz and project + dev deps.
- Runs unit suite only:
pytest -m unit(functional/documentation tests are opt-in). -
Uses the same Python version as lint.
-
Build examples/templates
- Installs graphviz + project.
- Runs
filareto generate outputs from examples/tutorials. -
Uploads
outputs/as an artifact for later stages. -
Text overlap check (pushes only)
- Uses Playwright/Chromium (container image) to detect overlapping text across generated HTML outputs.
-
Runs only on pushes (not PRs); uses
filare-check-overlapwith warning/error thresholds and optional ignores. -
Docs / gh-pages (main only)
- Copies
docs/intosite/and includes built example artifacts if present. -
Publishes
site/to GitHub Pages viapeaceiris/actions-gh-pages. -
Document representation build (planned)
- Build up to
DocumentRepresentationYAML (with hashes) without rendering final assets, to validate graph/document assembly. -
Useful for faster CI checks before full render/publish steps.
-
Release (semantic-release, main only)
- Uses
python-semantic-releaseto bump the version, updateVERSION, and publish release assets. - Gating: downstream publish/verify/container steps run only if either the
VERSIONfile changed or a new tag was created during the run (prevents double-publishing). - Generates/updates
CHANGELOG.mdautomatically and commits it with the release bump. -
Needs
GH_TOKEN(GitHub token) andPYPI_TOKEN(if publishing to PyPI through semantic-release). -
Publish to PyPI (main only)
- Builds the distribution (
python -m build). -
Uploads via
twineusingPYPI_TOKEN. -
Verify PyPI
-
Installs
filarefrom PyPI and checksfilare --help. -
Container (GHCR)
-
Builds a Docker image and pushes to
ghcr.io/${{ github.repository }}:latest. - Uses
GITHUB_TOKENfor registry auth.
Required Secrets¶
PYPI_TOKEN: PyPI API token for publishing.GH_TOKEN: (optional) used by semantic-release for tagging;GITHUB_TOKENprovided by Actions is usually sufficient.- GitHub Pages and GHCR steps use the built-in
GITHUB_TOKEN. - Tag-triggered release workflow (
release-on-tag.yml) relies onPYPI_TOKENandGITHUB_TOKEN; ensureVERSIONmatches the tag when releasing manually.
Local Reproduction¶
- Lint:
black --check src testsandprettier --check "docs/**/*.{md,html}" "src/filare/templates/**/*.html". - Tests:
pytest -m unit(usepytest -m "unit or functional" --include-functionalto add slow documentation/functional tests; ensuregraphvizis installed). - Examples:
filare -f hs -o outputs/examples examples/demo01.yml. - Build dist:
python -m build. - Docker:
docker build -t filare-local ..
Creating/Updating the Pipeline¶
- Edit
.github/workflows/ci.ymlto adjust stages, Python/Node versions, or paths. - Ensure secrets (
PYPI_TOKEN) are set in the repo settings. - Push to
betaormainto exercise lint/tests/examples and text-overlap checks; push tomainto run docs/publish/release. PRs tobetarun the dedicated beta PR lint/test workflow; PRs tomainrun the full CI. - For gh-pages, confirm Pages is enabled for the
gh-pagesbranch.