diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3140ffe..d9bc66c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,8 +3,8 @@ name: main on: [push, pull_request] jobs: - build: - name: Build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}) + test: + name: Test (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}) runs-on: ubuntu-latest @@ -12,11 +12,11 @@ jobs: matrix: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] django-version: ["4.2", "5.0"] - exclude: - - python-version: "3.8" - django-version: "5.0" - - python-version: "3.9" - django-version: "5.0" + # exclude: + # - python-version: "3.8" + # django-version: "5.0" + # - python-version: "3.9" + # django-version: "5.0" steps: - name: Checkout code @@ -31,5 +31,11 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements_test.txt - - name: Test with tox + - name: Run tests run: tox -- --keepdb --parallel + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + # - name: Run coverage + # run: tox -e coverage + # env: + # COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} diff --git a/requirements_test.txt b/requirements_test.txt index 014489d..a244fe9 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -3,7 +3,7 @@ coverage==7.5.1 mock>=5.1.0 flake8>=7.0.0 tox>=4.15.0 -codecov>=2.1.13 +tox-gh>=1.3.1 django-model-utils>=4.5.1 djangorestframework model_mommy diff --git a/tox.ini b/tox.ini index 7b06717..8eda555 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,19 @@ requires = tox>=4 envlist = + # Django official Python support + # Source: https://docs.djangoproject.com/en/5.0/faq/install/#what-python-version-can-i-use-with-django {py38,py39,py310,py311,py312}-django42 {py310,py311,py312}-django50 + coverage + +[gh] +python = + 3.12 = py312, coverage + 3.11 = py311 + 3.10 = py310 + 3.9 = py39 + 3.8 = py38 [testenv] description = run tests @@ -20,3 +31,15 @@ basepython = py310: python3.10 py39: python3.9 py38: python3.8 + +[testenv:coverage] +description = run coveralls +passenv = COVERALLS_REPO_TOKEN +allowlist_externals = coverage +basepython = python3.12 +deps = + {[testenv]deps} + coveralls +commands = + coverage run --source celerybeat_status runtests.py {posargs} + coveralls