ci: build the package and smoke-test both install profiles
docker / test (pull_request) Successful in 34s
docker / test (push) Successful in 36s
docker / lint (pull_request) Successful in 39s
docker / lint (push) Successful in 40s
test / test (push) Successful in 42s
test / package (pull_request) Failing after 2m27s
lint / lint (pull_request) Successful in 43s
lint / lint (push) Successful in 43s
test / test (pull_request) Successful in 44s
docker / docker (pull_request) Successful in 1m10s
docker / docker (push) Successful in 34s
test / package (push) Failing after 2m5s
docker / test (pull_request) Successful in 34s
docker / test (push) Successful in 36s
docker / lint (pull_request) Successful in 39s
docker / lint (push) Successful in 40s
test / test (push) Successful in 42s
test / package (pull_request) Failing after 2m27s
lint / lint (pull_request) Successful in 43s
lint / lint (push) Successful in 43s
test / test (pull_request) Successful in 44s
docker / docker (pull_request) Successful in 1m10s
docker / docker (push) Successful in 34s
test / package (push) Failing after 2m5s
Add a package job to the test workflow: uv build, then verify a clean core install excludes the web stack and the aegis-gitea-mcp stdio entry exits 2 with an actionable message, and that the [server] extra pulls in fastapi/uvicorn and imports the server entry. Catches packaging/console-script regressions in CI.
This commit is contained in:
@@ -31,3 +31,59 @@ jobs:
|
||||
- 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')"
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: dist
|
||||
path: dist/*
|
||||
|
||||
Reference in New Issue
Block a user