Fix release #84
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| validate-pyproject: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-dev | |
| - name: Validate pyproject.toml | |
| run: | | |
| uv run validate-pyproject pyproject.toml | |
| ruff: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-dev | |
| - name: Check with ruff | |
| run: | | |
| uv run -m ruff check | |
| mypy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-dev | |
| - name: Check with mypy | |
| run: | | |
| uv run -m mypy . | |
| pytest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-dev | |
| - name: Test with pytest | |
| run: | | |
| uv run -m pytest --cov-report html --cov-report term | |
| - name: Upload backend coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: backend-coverage-report | |
| path: htmlcov | |
| bandit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-dev | |
| - name: Security check | |
| run: | | |
| uv run bandit -r python_template_server/ -f json -o bandit-report.json || true | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: bandit-report | |
| path: bandit-report.json | |
| pip-audit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-dev | |
| - name: Audit dependencies | |
| run: | | |
| uv run pip-audit --desc | |
| version-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-python-dev | |
| - name: Check version consistency | |
| run: | | |
| echo "Checking version consistency across all package files..." | |
| PACKAGE_NAME="python-template-server" | |
| TOML_VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])") | |
| LOCK_VERSION=$(uv run python -c "import tomllib; lock_data = tomllib.load(open('uv.lock', 'rb')); pkg = next((p for p in lock_data['package'] if p['name'] == '${PACKAGE_NAME}'), None); print(pkg['version'] if pkg else 'not found')") | |
| echo "Version in pyproject.toml: $TOML_VERSION" | |
| echo "Version in uv.lock: $LOCK_VERSION" | |
| if [ "$TOML_VERSION" != "$LOCK_VERSION" ]; then | |
| echo "ERROR: Python version mismatch!" | |
| echo "pyproject.toml has $TOML_VERSION but uv.lock has $LOCK_VERSION" | |
| exit 1 | |
| fi | |
| echo "All versions match: $TOML_VERSION" | |
| echo "Version consistency check passed!" |