60 lines
1.3 KiB
YAML
60 lines
1.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
|
|
jobs:
|
|
unit-tests:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: astral-sh/setup-uv@v5
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Run unit tests
|
|
run: uv run --extra dev pytest tests/unit/ -v --tb=short
|
|
|
|
integration-tests:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: astral-sh/setup-uv@v5
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Pull container image
|
|
run: docker pull python:3.11-slim
|
|
|
|
- name: Run integration tests
|
|
run: uv run --extra dev pytest tests/integration/ -v --tb=short
|
|
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
needs: [unit-tests, integration-tests]
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: astral-sh/setup-uv@v5
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Build package
|
|
run: uv build
|
|
|
|
- name: Publish to Gitea package registry
|
|
env:
|
|
UV_PUBLISH_URL: ${{ gitea.server_url }}/api/packages/${{ github.repository_owner }}/pypi
|
|
UV_PUBLISH_USERNAME: ${{ github.repository_owner }}
|
|
UV_PUBLISH_PASSWORD: ${{ secrets.GITEA_TOKEN }}
|
|
run: uv publish
|