4db37d200e
docker / test (push) Successful in 34s
docker / lint (push) Successful in 40s
lint / lint (push) Successful in 43s
docker / lint (pull_request) Successful in 43s
docker / test (pull_request) Successful in 34s
test / test (push) Successful in 44s
lint / lint (pull_request) Successful in 44s
test / package (push) Successful in 1m8s
test / test (pull_request) Successful in 44s
test / package (pull_request) Successful in 53s
docker / docker (push) Successful in 1m5s
docker / docker (pull_request) Successful in 43s
Gitea's act_runner does not reliably support the actions/upload-artifact@v4 backend. Drop the artifact upload from the test workflow (the package job's purpose is to build and smoke-test, not to store wheels) and make the publish workflow's upload best-effort (continue-on-error) so a flaky artifact backend cannot block a release — the package is still published to the registry.
84 lines
2.6 KiB
YAML
84 lines
2.6 KiB
YAML
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')"
|