name: test on: push: pull_request: jobs: test: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.12' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements-dev.txt - name: Run lint run: | ruff check src tests ruff format --check src tests black --check src tests - name: Run tests with coverage gate run: | pytest --cov=aegis_gitea_mcp --cov-report=term-missing --cov-fail-under=80 # --------------------------------------------------------------------------- # Package: build with uv and smoke-test both install profiles so packaging # regressions (broken console scripts, dependency split) are caught in CI. # --------------------------------------------------------------------------- package: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.12" - name: Set up uv uses: astral-sh/setup-uv@v5 - name: Build sdist + wheel run: uv build - name: Smoke-test the core (stdio) install shell: bash run: | WHEEL="$(echo dist/*.whl)" python -m venv /tmp/core /tmp/core/bin/pip install --quiet "$WHEEL" # The core install must NOT pull in the web stack. if /tmp/core/bin/python -c "import importlib.util,sys; sys.exit(0 if importlib.util.find_spec('fastapi') else 1)"; then echo "::error::core install unexpectedly includes fastapi" >&2 exit 1 fi # The stdio console script exists and exits 2 with a clear error when # required env vars are missing (no traceback). set +e GITEA_URL= GITEA_TOKEN= /tmp/core/bin/aegis-gitea-mcp >/dev/null 2>/tmp/core_err.txt rc=$? set -e test "$rc" = "2" || { echo "::error::stdio entry exit $rc (expected 2)"; cat /tmp/core_err.txt; exit 1; } grep -q "GITEA_URL" /tmp/core_err.txt echo "core stdio entry OK (exit 2, no fastapi)" - name: Smoke-test the [server] install shell: bash run: | WHEEL="$(echo dist/*.whl)" python -m venv /tmp/server /tmp/server/bin/pip install --quiet "${WHEEL}[server]" /tmp/server/bin/python -c "import fastapi, uvicorn, aegis_gitea_mcp.server_entry; print('server extra import OK')"