Skip to content

Commit

Permalink
Add tox-gh and coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
pamella committed May 16, 2024
1 parent e867543 commit 18fadbf
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 9 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ 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

strategy:
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
Expand All @@ -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 }}
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 23 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 18fadbf

Please sign in to comment.