diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..aab12ec --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + lint: + name: Lint & format + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.11", "3.12", "3.13"] + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: uv sync --extra dev + - name: Ruff check + run: uv run ruff check nepali_payment tests examples/payments + - name: Ruff format check + run: uv run ruff format --check nepali_payment tests examples/payments + + test: + name: Test (Python ${{ matrix.python-version }} ยท Django ${{ matrix.django-version }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.11", "3.12", "3.13"] + django-version: ["4.2", "5.0"] + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: uv sync --extra dev + - name: Install Django ${{ matrix.django-version }} + run: uv pip install "Django~=${{ matrix.django-version }}.0" + - name: Run tests with coverage gate + run: uv run pytest --cov=nepali_payment --cov-fail-under=80 + + build: + name: Build package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + with: + python-version: "3.12" + - name: Build sdist and wheel + run: uv build + - uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/