diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9448f8..e226834 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ on: branches: [master] pull_request: branches: - - "**" + - "**" jobs: run_tests: @@ -14,38 +14,35 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - python-version: ["3.8"] - toxenv: - [ - py38-django32-drf312, - py38-django32-drflatest, - py38-django42-drflatest, - quality, - ] + python-version: + - "3.8" + - '3.12' + toxenv: [py38-django32-drf312, py38-django32-drflatest, py38-django42-drflatest, + quality, django42] steps: - - uses: actions/checkout@v4 - - name: setup python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} + - uses: actions/checkout@v4 + - name: setup python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} - - name: Install pip - run: pip install -r requirements/pip.txt + - name: Install pip + run: pip install -r requirements/pip.txt - - name: Install Dependencies - run: | - pip install -r requirements/ci.txt - pip install -r requirements/quality.txt + - name: Install Dependencies + run: | + pip install -r requirements/ci.txt + pip install -r requirements/quality.txt - - name: Run Tests - env: - TOXENV: ${{ matrix.toxenv }} - run: tox + - name: Run Tests + env: + TOXENV: ${{ matrix.toxenv }} + run: tox - - name: Run Coverage - if: matrix.python-version == '3.8' && matrix.toxenv=='py38-django42-drflatest' - uses: codecov/codecov-action@v3 - with: - flags: unittests - fail_ci_if_error: true + - name: Run Coverage + if: matrix.python-version == '3.8' && matrix.toxenv=='py38-django42-drflatest' + uses: codecov/codecov-action@v3 + with: + flags: unittests + fail_ci_if_error: true diff --git a/tox.ini b/tox.ini index 1c380fb..941885a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,44 +1,42 @@ [tox] -envlist = - py38-django{32}-drf{312, latest} - py38-django{42}-drf{latest} # Django 4.2 is not supported by DRF < 3.14 +envlist = + py{38, 312}-django{42}-drf{latest} # Django 4.2 is not supported by DRF < 3.14 quality [pytest] -DJANGO_SETTINGS_MODULE = test_settings +django_settings_module = test_settings addopts = --cov edx_api_doc_tools --cov-report term-missing --cov-report xml norecursedirs = .* docs requirements [testenv] -deps = - django32: Django>=3.2,<4.0 +deps = django42: Django>=4.2,<4.3 drf312: djangorestframework>=3.13,<3.14 drflatest: djangorestframework -r{toxinidir}/requirements/test.txt -commands = +commands = pytest {posargs} [testenv:docs] -setenv = +setenv = DJANGO_SETTINGS_MODULE = test_settings PYTHONPATH = {toxinidir} -allowlist_externals = +allowlist_externals = make rm -deps = +deps = -r{toxinidir}/requirements/doc.txt -commands = +commands = make build_docs [testenv:quality] -setenv = +setenv = PYTHONPATH = {toxinidir} -allowlist_externals = +allowlist_externals = make rm -deps = +deps = -r{toxinidir}/requirements/quality.txt -commands = +commands = make quality