From bb2a8825e0c38eb291b24b1bc92f399dfe77ceee Mon Sep 17 00:00:00 2001 From: Frederico Araujo Date: Wed, 22 Apr 2026 00:08:05 -0400 Subject: [PATCH 1/3] chore: add ci tests and doc checks Signed-off-by: Frederico Araujo --- .github/workflows/ci.yml | 8 +++ .github/workflows/docs-build.yaml | 46 ++++++++++++++ .../workflows/{docs.yaml => docs-deploy.yaml} | 2 +- .github/workflows/tests.yaml | 61 +++++++++++++++++++ 4 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docs-build.yaml rename .github/workflows/{docs.yaml => docs-deploy.yaml} (98%) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25798c33..ec838293 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,3 +22,11 @@ jobs: lint: name: Lint & Static Analysis uses: ./.github/workflows/lint.yml + + test: + name: Tests + uses: ./.github/workflows/tests.yaml + + docs: + name: Docs Build + uses: ./.github/workflows/docs-build.yaml diff --git a/.github/workflows/docs-build.yaml b/.github/workflows/docs-build.yaml new file mode 100644 index 00000000..4e1ec664 --- /dev/null +++ b/.github/workflows/docs-build.yaml @@ -0,0 +1,46 @@ +# =============================================================== +# Docs Build - Verify documentation builds without errors +# =============================================================== + +name: Docs Build + +on: + workflow_call: + push: + branches: ["main"] + paths: + - "docs/**" + - ".github/workflows/docs-build.yaml" + pull_request: + types: [opened, synchronize, ready_for_review] + branches: ["main"] + paths: + - "docs/**" + - ".github/workflows/docs-build.yaml" + +permissions: + contents: read + +jobs: + docs-build: + if: github.event_name != 'pull_request' || !github.event.pull_request.draft + name: Hugo Build + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Checkout source + uses: actions/checkout@v5 + with: + submodules: recursive + fetch-depth: 1 + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v3 + with: + hugo-version: "latest" + extended: true + + - name: Build docs + working-directory: docs + run: hugo --minify diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs-deploy.yaml similarity index 98% rename from .github/workflows/docs.yaml rename to .github/workflows/docs-deploy.yaml index 2e1081d4..4ec390ff 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs-deploy.yaml @@ -2,7 +2,7 @@ # Deploy Documentation to GitHub Pages # =============================================================== -name: Docs +name: Docs Deploy on: push: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 00000000..96ffa61a --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,61 @@ +# =============================================================== +# Tests - Run the test suite +# =============================================================== + +name: Tests + +on: + workflow_call: + push: + branches: ["main"] + paths: + - "cpex/**" + - "tests/**" + - "pyproject.toml" + - ".github/workflows/tests.yaml" + pull_request: + types: [opened, synchronize, ready_for_review] + branches: ["main"] + paths: + - "cpex/**" + - "tests/**" + - "pyproject.toml" + - ".github/workflows/tests.yaml" + workflow_dispatch: + +permissions: + contents: read + +jobs: + test: + if: github.event_name != 'pull_request' || !github.event.pull_request.draft + strategy: + fail-fast: false + matrix: + python-version: ["3.11", "3.12", "3.13"] + os: [ubuntu-latest] + + name: "Python ${{ matrix.python-version }}" + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + + steps: + - name: Checkout source + uses: actions/checkout@v5 + with: + fetch-depth: 1 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + cache: pip + + - name: Install dependencies + run: | + python3 -m pip install --upgrade pip + pip install -e ".[dev,all]" + + - name: Run tests + run: | + PYTHONPATH=cpex pytest -n auto tests From 56a34cb90746cadb60e9c29b138e6a4f4601fb68 Mon Sep 17 00:00:00 2001 From: Frederico Araujo Date: Wed, 22 Apr 2026 00:13:06 -0400 Subject: [PATCH 2/3] docs: minor update Signed-off-by: Frederico Araujo --- docs/content/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/_index.md b/docs/content/_index.md index cc4be6d2..a8376aae 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -5,7 +5,7 @@ type: docs # CPEX -**A lightweight, composable plugin framework for building extensible AI systems.** +**A lightweight plugin framework for building extensible AI systems** CPEX lets you intercept, enforce, and extend application behavior through plugins — without modifying core logic. Define hook points in your application, write plugins that attach to them, and compose enforcement pipelines that run automatically. From 4ef040815ad7f05fafe8c9034cb349ffd663da5e Mon Sep 17 00:00:00 2001 From: Frederico Araujo Date: Wed, 22 Apr 2026 00:27:52 -0400 Subject: [PATCH 3/3] tests: added click.unstyle() to strip ANSI codes from the help output in the CLI before asserting Signed-off-by: Frederico Araujo --- tests/unit/cpex/tools/test_cli.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/unit/cpex/tools/test_cli.py b/tests/unit/cpex/tools/test_cli.py index 69cdd2e5..b9cef5fe 100644 --- a/tests/unit/cpex/tools/test_cli.py +++ b/tests/unit/cpex/tools/test_cli.py @@ -12,6 +12,7 @@ from unittest.mock import MagicMock, patch # We use typer's CliRunner for testing typer apps +import click from typer.testing import CliRunner # Third-Party @@ -124,12 +125,13 @@ def test_help_exits_zero(self): def test_help_contains_options(self): result = runner.invoke(app, ["bootstrap", "--help"]) - assert "--destination" in result.output - assert "--template_type" in result.output - assert "--template_url" in result.output - assert "--vcs_ref" in result.output - assert "--no_input" in result.output - assert "--dry_run" in result.output + output = click.unstyle(result.output) + assert "--destination" in output + assert "--template_type" in output + assert "--template_url" in output + assert "--vcs_ref" in output + assert "--no_input" in output + assert "--dry_run" in output class TestBootstrapDryRun: