Compare commits

...

15 Commits

4 changed files with 95 additions and 11 deletions

73
.github/workflows/django.yml vendored Normal file
View File

@ -0,0 +1,73 @@
name: Django CI
on:
push:
branches: [ master ]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
ports:
- 5432:5432
# Provide the password for postgres
env:
POSTGRES_DB: test_myapp
POSTGRES_USER: testuser
POSTGRES_PASSWORD: s3cretPass
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
max-parallel: 4
matrix:
python-version: [3.6]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update -qy
sudo apt-get -y install python3-dev libxml2 libxml2-dev libxslt-dev bind9utils ca-certificates gettext libcrack2-dev libxml2-dev libxslt1-dev ssh-client wget xvfb zlib1g-dev git iceweasel dnsutils postgresql-contrib libgirepository1.0-dev
python -m pip install --upgrade pip
pip install wheel
pip install -e .
pip install -r requirements.txt
pip install -r requirements-testing.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
- name: Run Tests
run: |
# orchestra-admin startproject panel
django-admin.py startproject panel --template=orchestra/conf/project_template -v3
coverage run --source='orchestra' panel/manage.py test orchestra --noinput -v3
coverage report
coverage xml
env:
DATABASE_URL: postgres://testuser:s3cretPass@localhost:5432/test_myapp
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

View File

@ -116,12 +116,12 @@ WSGI_APPLICATION = '{{ project_name }}.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'test_myapp',
'USER': 'testuser',
'PASSWORD': 's3cretPass',
'HOST': 'localhost',
'PORT': '5432',
'CONN_MAX_AGE': 60*10 # Enable persistent connections
}
}

11
requirements-testing.txt Normal file
View File

@ -0,0 +1,11 @@
selenium
xvfbwrapper
freezegun
coverage
flake8
django-debug-toolbar==1.3.0
django-nose==1.4.4
sqlparse
pyinotify
PyMySQL
psycopg2-binary

View File

@ -1,4 +1,4 @@
Django==1.10.5
Django==1.11.29
django-fluent-dashboard==0.6.1
django-admin-tools==0.8.0
django-extensions==1.7.4
@ -7,17 +7,17 @@ celery==3.1.23
kombu==3.0.35
billiard==3.3.0.23
Markdown==2.4
djangorestframework==3.4.7
djangorestframework==3.9.4
ecdsa==0.11
Pygments==1.6
django-filter==0.15.2
django-filter==1.0.2
jsonfield==0.9.22
python-dateutil==2.2
https://github.com/glic3rinu/passlib/archive/master.zip
passlib==1.7.0
django-iban==0.3.0
requests
phonenumbers
django-countries
django-countries==5.5
django-localflavor
amqp
anyjson