-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bdd2d0d
commit a970190
Showing
15 changed files
with
609 additions
and
1,296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Django Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
# Set the secret for the code coverage tool | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | ||
|
||
strategy: | ||
matrix: | ||
python-version: ["3.12"] | ||
|
||
steps: | ||
# Check out the code from the repository | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# Set up Python environment | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# Install dependencies | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install django==4.2 | ||
pip install -r github-actions-requirements.txt | ||
# Prepare code coverage reporting | ||
- name: Install Code Climate Test Reporter | ||
run: | | ||
pip install codeclimate-test-reporter | ||
# Run tests | ||
- name: Run tests with coverage | ||
run: | | ||
coverage run -m pytest . | ||
coverage report --fail-under=90 -m | ||
# Upload coverage data to Code Climate | ||
- name: Setup Code Climate test-reporter | ||
run: | | ||
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | ||
chmod +x ./cc-test-reporter | ||
./cc-test-reporter before-build | ||
./cc-test-reporter after-build --coverage-input-type coverage.py --exit-code $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,49 @@ | ||
name: Django Drip Campaigns | ||
name: Django Drips Tests | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
build: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
# python 3.4 | ||
- python-version: "3.5" | ||
django-version: "2.2" | ||
# python 3.6 | ||
- python-version: "3.6" | ||
django-version: "2.2" | ||
- python-version: "3.6" | ||
django-version: "3.2" | ||
# python 3.7 | ||
- python-version: "3.7" | ||
django-version: "2.2" | ||
- python-version: "3.7" | ||
django-version: "3.2" | ||
# python 3.8 | ||
- python-version: "3.8" | ||
django-version: "2.2" | ||
- python-version: "3.8" | ||
django-version: "3.2" | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
django-version: ["4.2", "5.0"] | ||
# Exclude incompatible combinations (if Django 5.0 does not support older Python versions) | ||
exclude: | ||
- python-version: "3.8" | ||
django-version: "4.0" | ||
# python 3.9 | ||
django-version: "5.0" | ||
- python-version: "3.9" | ||
django-version: "2.2" | ||
- python-version: "3.9" | ||
django-version: "3.2" | ||
- python-version: "3.9" | ||
django-version: "4.0" | ||
# pypy3 | ||
- python-version: "pypy3" | ||
django-version: "2.2" | ||
- python-version: "pypy3" | ||
django-version: "3.2" | ||
runs-on: ubuntu-latest | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | ||
django-version: "5.0" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
# Checkout the repository | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# Set up the Python environment based on the matrix versions | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Set up Python version ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
# Install dependencies | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install django==${{ matrix.django-version }} | ||
pip install -r github-actions-requirements.txt | ||
- name: Installing resources | ||
run: | | ||
pip install --upgrade pip==20.0.2 | ||
pip install pipenv | ||
- name: Installing requirements pipenv | ||
run: | | ||
pipenv install --dev | ||
- name: Installing Django version ${{ matrix.django-version }} | ||
run: | | ||
pip install Django==${{ matrix.django-version }} | ||
- name: Checking PEP8 code style | ||
run: | | ||
pipenv run flake8 --count | ||
- name: Checking Black code formatter | ||
run: | | ||
pipenv run black . --check | ||
- name: Check typing | ||
run: | | ||
pipenv run mypy --namespace-packages --explicit-package-bases --ignore-missing-imports --no-warn-unused-ignores . | ||
- name: Running tests | ||
run: | | ||
pipenv run coverage run -m pytest --ds=testsettings | ||
- name: Checking coverage | ||
run: | | ||
pipenv run coverage report --fail-under=90 -m | ||
pipenv run coverage xml | ||
- name: Setup Code Climate test-reporter | ||
run: | | ||
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | ||
chmod +x ./cc-test-reporter | ||
./cc-test-reporter before-build | ||
./cc-test-reporter after-build --coverage-input-type coverage.py --exit-code $? | ||
# Run tests | ||
- name: Install coverage codeclimate | ||
run: | | ||
pytest . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,103 @@ | ||
*.pyc | ||
MANIFEST | ||
#pyenv | ||
.python-version | ||
|
||
dist/ | ||
.tox/ | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
docs/_build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.idea/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
sqlite.db | ||
settings.py | ||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
env* | ||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
__pycache__ | ||
# Virtualenv | ||
# If you use a virtualenv, it's better to ignore its directory. | ||
venv/ | ||
ENV/ | ||
env/ | ||
.venv/ | ||
.pyenv/ | ||
|
||
*DS_Store | ||
# tox | ||
.tox/ | ||
.cache/ | ||
.coverage | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
|
||
.vscode | ||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
#pyenv | ||
.python-version | ||
# Pytest cache | ||
.pytest_cache/ | ||
|
||
# Django specific | ||
*.log | ||
db.sqlite3 | ||
media/ | ||
staticfiles/ | ||
|
||
# Ignore migrations files (optional, you might want to track migrations in OSS) | ||
# **/migrations/ | ||
|
||
# Ignore Django secret key file (if it exists) | ||
.env | ||
.env.* | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# macOS | ||
.DS_Store | ||
|
||
# System files | ||
Thumbs.db | ||
desktop.ini | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints/ | ||
|
||
# IDEs | ||
.vscode/ | ||
.idea/ | ||
*.sublime-workspace | ||
*.sublime-project | ||
|
||
# Documentation artifacts | ||
docs/_build/ | ||
|
||
# SQLite | ||
sqlite.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.