From 71ddd88e26d127eb509c5a8fd5c348c7ae0b094a Mon Sep 17 00:00:00 2001 From: Conor Holden Date: Tue, 22 Oct 2024 17:23:20 +0200 Subject: [PATCH] :green_heart:[#114] update CI for setup configuration --- .github/workflows/ci.yml | 9 +++++++-- pyproject.toml | 3 +++ tox.ini | 10 +++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 992386c..991ec6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,8 +18,10 @@ jobs: python: ['3.10', '3.11', '3.12'] django: ['4.2'] mozilla_django_oidc: ['4.0'] + setup_config_enabled: ['no', 'yes'] - name: Run the test suite (Python ${{ matrix.python }}, Django ${{ matrix.django }}, mozilla-django-oidc ${{ matrix.mozilla_django_oidc }}) + name: "Run the test suite (Python ${{ matrix.python }}, Django ${{ matrix.django }}, + mozilla-django-oidc ${{ matrix.mozilla_django_oidc }}, Setup Config: ${{ matrix.setup_config_enabled }}))" services: postgres: @@ -41,18 +43,21 @@ jobs: run: pip install tox tox-gh-actions - name: Run tests - run: tox + run: | + tox -- ${{ matrix.setup_config_enabled != 'yes' && '--ignore tests/setupconfig' || '' }} env: PYTHON_VERSION: ${{ matrix.python }} DJANGO: ${{ matrix.django }} MOZILLA_DJANGO_OIDC: ${{ matrix.mozilla_django_oidc }} PGUSER: postgres PGHOST: localhost + SETUP_CONFIG_ENABLED: ${{ matrix.setup_config_enabled }} - name: Publish coverage report uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} + flags: ${{ matrix.setup_config_enabled == 'yes' && 'setupconfig' || 'base' }} publish: name: Publish package to PyPI diff --git a/pyproject.toml b/pyproject.toml index ccc89a4..f1ee62c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,6 +43,9 @@ Documentation = "https://mozilla-django-oidc-db.readthedocs.io/en/latest/" Changelog = "https://github.com/maykinmedia/mozilla-django-oidc-db/blob/master/CHANGELOG.rst" [project.optional-dependencies] +setupconfig = [ + "django-setup-configuration@git+https://github.com/maykinmedia/django-setup-configuration.git@ba0ed8a14acf0ffe05244f53b78fb343c6e5c3df", +] tests = [ "psycopg2", "pytest", diff --git a/tox.ini b/tox.ini index 2ea6c0b..2425fea 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{310,311,312}-django{42}-mozilla_django_oidc{40} + py{310,311,312}-django{42}-mozilla_django_oidc{40}-setup_config_{enabled,disabled} isort black docs @@ -17,10 +17,15 @@ DJANGO = 4.2: django42 MOZILLA_DJANGO_OIDC = 4.0: mozilla_django_oidc40 +SETUP_CONFIG_ENABLED = + yes: setup_config_enabled + no: setup_config_disabled + [testenv] extras = tests coverage + setup_config_enabled: setupconfig deps = django42: Django~=4.2.0 mozilla_django_oidc40: mozilla-django-oidc~=4.0.0 @@ -30,8 +35,10 @@ passenv = PGPASSWORD PGPORT PGHOST + SETUP_CONFIG_ENABLED setenv = PYTHONPATH = {toxinidir} + commands = pytest tests \ --cov --cov-report xml:reports/coverage-{envname}.xml \ @@ -52,6 +59,7 @@ basepython=python changedir=docs skipsdist=true extras = + setupconfig db docs tests