Skip to content

Commit

Permalink
💚[#114] update CI for setup configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Coperh committed Nov 22, 2024
1 parent a63657e commit 71ddd88
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 9 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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 \
Expand All @@ -52,6 +59,7 @@ basepython=python
changedir=docs
skipsdist=true
extras =
setupconfig
db
docs
tests
Expand Down

0 comments on commit 71ddd88

Please sign in to comment.