mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-16 20:00:23 +00:00
Run Postgres 10 during testing.
This commit is contained in:
parent
24c196ebe3
commit
5b3672b980
3 changed files with 27 additions and 4 deletions
21
.github/workflows/test.yml
vendored
21
.github/workflows/test.yml
vendored
|
|
@ -11,6 +11,21 @@ jobs:
|
|||
matrix:
|
||||
python-version: ['3.6', '3.7', '3.8']
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: postgres
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
|
|
@ -41,6 +56,12 @@ jobs:
|
|||
- name: Tox tests
|
||||
run: |
|
||||
tox -v -- --cov --cov-append --cov-report term-missing --cov-report xml
|
||||
env:
|
||||
DB_NAME: postgres
|
||||
DB_USER: postgres
|
||||
DB_PASSWORD: postgres
|
||||
DB_HOST: localhost
|
||||
DB_PORT: 5432
|
||||
|
||||
- name: Upload coverage
|
||||
uses: codecov/codecov-action@v1
|
||||
|
|
|
|||
|
|
@ -7,10 +7,11 @@ INSTALLED_APPS = (
|
|||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.postgresql_psycopg2",
|
||||
"NAME": os.environ.get("DJANGO_DATABASE_NAME_POSTGRES", "modelutils"),
|
||||
"USER": os.environ.get("DJANGO_DATABASE_USER_POSTGRES", 'postgres'),
|
||||
"PASSWORD": os.environ.get("DJANGO_DATABASE_PASSWORD_POSTGRES", ""),
|
||||
"HOST": os.environ.get("DJANGO_DATABASE_HOST_POSTGRES", ""),
|
||||
"NAME": os.environ.get("DB_NAME", "modelutils"),
|
||||
"USER": os.environ.get("DB_USER", 'postgres'),
|
||||
"PASSWORD": os.environ.get("DB_PASSWORD", ""),
|
||||
"HOST": os.environ.get("DB_HOST", ""),
|
||||
"PORT": os.envrion.get("DB_PORT", 5432)
|
||||
},
|
||||
}
|
||||
SECRET_KEY = 'dummy'
|
||||
|
|
|
|||
1
tox.ini
1
tox.ini
|
|
@ -23,6 +23,7 @@ ignore_outcome =
|
|||
passenv =
|
||||
CI
|
||||
GITHUB_*
|
||||
DB_*
|
||||
usedevelop = True
|
||||
commands =
|
||||
pytest {posargs}
|
||||
|
|
|
|||
Loading…
Reference in a new issue