From 8f657f6e8b5d3568cc63dfb027aeafe620fdeaab Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Thu, 5 Feb 2026 08:35:44 +0000 Subject: [PATCH] Add Gitea Actions workflow: ci.yml --- .gitea/workflows/ci.yml | 96 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..aa3d1df --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,96 @@ +name: CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: 'pip' + + - name: Install dependencies + run: | + pip install -e ".[dev]" + + - name: Run linters + run: | + ruff check . + black --check src/ tests/ + isort --check-only src/ tests/ + flake8 src/ tests/ + + - name: Run type checks + run: | + python -m mypy src/ --ignore-missing-imports || true + + - name: Run tests + run: | + pytest -xvs --cov=src --cov-report=term-missing + + - name: Upload coverage + uses: codecov/codecov-action@v4 + with: + files: ./coverage.xml + fail_ci_if_error: false + + build: + runs-on: ubuntu-latest + needs: test + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install build dependencies + run: | + pip install build + + - name: Build package + run: | + python -m build + + - name: Verify package + run: | + pip install dist/*.whl --force-reinstall + auto-readme --version + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + + release: + runs-on: ubuntu-latest + needs: build + if: startsWith(github.ref, 'refs/tags/v') + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + + - name: Create Release + uses: https://gitea.com/actions/release-action@main + with: + files: dist/** + title: ${{ github.event.release.name }} + note: See CHANGELOG.md for details