Testing github alternative action for postgres
This commit is contained in:
parent
86c65b08d7
commit
094478c337
2 changed files with 23 additions and 5 deletions
19
.github/workflows/github_action_test_suite.yml
vendored
19
.github/workflows/github_action_test_suite.yml
vendored
|
|
@ -32,10 +32,26 @@ jobs:
|
||||||
UNIT_TEST_SETTINGS: "--settings=settings --keepdb --timing"
|
UNIT_TEST_SETTINGS: "--settings=settings --keepdb --timing"
|
||||||
COVERAGE_TEST_SETTINGS: "--settings=settings --timing"
|
COVERAGE_TEST_SETTINGS: "--settings=settings --timing"
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:12
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
POSTGRES_DB: evennia
|
||||||
|
options: >-
|
||||||
|
--health-cmd pg_isready
|
||||||
|
--health-interval 10s
|
||||||
|
--health-timeout 5s
|
||||||
|
--health-retries 5s
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up database (${{ matrix.TESTING_DB }})
|
- name: Set up database (${{ matrix.TESTING_DB }})
|
||||||
|
if: matrix.TESTING_DB != 'postgresql'
|
||||||
uses: ./.github/actions/setup-database
|
uses: ./.github/actions/setup-database
|
||||||
with:
|
with:
|
||||||
database: ${{ matrix.TESTING_DB }}
|
database: ${{ matrix.TESTING_DB }}
|
||||||
|
|
@ -74,6 +90,9 @@ jobs:
|
||||||
working-directory: testing_mygame
|
working-directory: testing_mygame
|
||||||
run: |
|
run: |
|
||||||
evennia test ${{ env.UNIT_TEST_SETTINGS }} evennia
|
evennia test ${{ env.UNIT_TEST_SETTINGS }} evennia
|
||||||
|
env:
|
||||||
|
POSTGRES_HOST: localhost
|
||||||
|
POSTGRES_PORT: 5432
|
||||||
|
|
||||||
# OBS - it's important to not run the coverage tests with --parallel, it messes up the coverage
|
# OBS - it's important to not run the coverage tests with --parallel, it messes up the coverage
|
||||||
# calculation!
|
# calculation!
|
||||||
|
|
|
||||||
9
.github/workflows/postgresql_settings.py
vendored
9
.github/workflows/postgresql_settings.py
vendored
|
|
@ -42,11 +42,10 @@ DATABASES = {
|
||||||
"default": {
|
"default": {
|
||||||
"ENGINE": "django.db.backends.postgresql",
|
"ENGINE": "django.db.backends.postgresql",
|
||||||
"NAME": "evennia",
|
"NAME": "evennia",
|
||||||
"USER": "evennia",
|
"USER": "postgresql", # evennia
|
||||||
"PASSWORD": "password",
|
"PASSWORD": "postgres",
|
||||||
"HOST": "localhost",
|
"HOST": os.environ.get("POSTGRES_HOST", "localhost"),
|
||||||
"PORT": "", # use default
|
"PORT": os.environ.get("POSTGRES_PORT", "5432"),
|
||||||
"TEST": {"NAME": "default"},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue