From 98b73c45fb45e3ace5aaef96b188f2d02340e9c1 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Fri, 30 Jan 2026 18:43:03 +0545 Subject: [PATCH] added workflow --- .github/workflows/django-ci.yml | 76 +++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/django-ci.yml diff --git a/.github/workflows/django-ci.yml b/.github/workflows/django-ci.yml new file mode 100644 index 0000000..27de73d --- /dev/null +++ b/.github/workflows/django-ci.yml @@ -0,0 +1,76 @@ +name: Django CI + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main, develop ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] + django-version: ['4.2', '5.0', '5.1', '6.0'] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + + - name: Install dependencies + run: | + uv sync + uv pip install "Django==${{ matrix.django-version }}.*" + + - name: Run tests with coverage + env: + DJANGO_SETTINGS_MODULE: django_nepkit.tests.settings + run: | + uv run pytest django_nepkit/tests/ --cov=django_nepkit --cov-report=xml --cov-report=term + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + file: ./coverage.xml + flags: unittests + name: codecov-umbrella + fail_ci_if_error: false + + - name: Run linting + run: | + uv run ruff check django_nepkit/ + continue-on-error: true + + 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 uv + uses: astral-sh/setup-uv@v5 + + - name: Build package + run: | + uv build + + - name: Check package + run: | + uv run twine check dist/*