ci: Add test and publish action
Some checks failed
CI / test (push) Successful in 35s
CI / publish (push) Failing after 12s

This commit is contained in:
2026-03-16 14:19:04 +01:00
parent 156727e689
commit 0bdb817f26
2 changed files with 54 additions and 1 deletions

53
.gitea/workflows/ci.yml Normal file
View File

@@ -0,0 +1,53 @@
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m venv .venv
.venv/bin/pip install -e ".[dev]" -q
- name: Run tests
run: .venv/bin/pytest tests/ -v
publish:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build package
run: |
pip install build -q
python -m build
- name: Publish to Gitea package registry
env:
TWINE_USERNAME: ${{ github.repository_owner }}
TWINE_PASSWORD: ${{ secrets.GITEA_TOKEN }}
run: |
pip install twine -q
twine upload \
--repository-url ${{ gitea.server_url }}/api/packages/${{ github.repository_owner }}/pypi \
dist/*

View File

@@ -9,7 +9,7 @@ requires-python = ">=3.10"
dependencies = ["mcp>=1.0"]
[project.optional-dependencies]
dev = ["pytest", "pytest-asyncio", "anyio"]
dev = ["pytest", "pytest-asyncio", "anyio", "build", "twine"]
[tool.setuptools.packages.find]
where = ["src"]