diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..d35c1bc --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,91 @@ +name: CI + +on: + push: + pull_request: + +jobs: + + style-check: + name: Code Style (autopep8) + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install PDM + autopep8 + run: | + python -m pip install --upgrade pip + pip install pdm autopep8 + + - name: Install dependencies + run: pdm install --dev + + - name: Run autopep8 style check + run: | + autopep8 --recursive --diff src + continue-on-error: false + + + tests: + name: Tests (Python ${{ matrix.python-version }}) + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: ["3.12", "3.13", "3.14"] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install PDM + run: | + python -m pip install --upgrade pip + pip install pdm + + - name: Install dependencies + run: pdm install --dev + + - name: Run tests + run: pdm run test + + + coverage: + name: Coverage (Python 3.12) + runs-on: ubuntu-latest + needs: tests + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install PDM + coverage + run: | + python -m pip install --upgrade pip + pip install pdm coverage + + - name: Install dependencies + run: pdm install --dev + + - name: Run coverage + run: pdm run coverage + + - name: Enforce minimum coverage + run: coverage report --fail-under=80