[Resolve merge conflicts

This commit is contained in:
Griatch 2020-09-19 14:19:40 +02:00
commit 77ca1b6175
22 changed files with 76 additions and 129 deletions

View file

@ -1,7 +1,7 @@
# This Evennia workflow will install Python dependencies, run tests with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Evennia test-suite and coveralls
name: test-suite
on:
push:
@ -14,11 +14,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8]
# TODO: mysql disabled, not able to connect to it so far
TESTING_DB: ['sqlite3', 'postgresql'] # , 'mysql']
fail-fast: False
TESTING_DB: ['sqlite3', 'postgresql', 'mysql']
steps:
@ -36,7 +35,7 @@ jobs:
uses: mirromutth/mysql-action@v1.1
if: ${{ matrix.TESTING_DB == 'mysql'}}
with:
mysql version: '5.7'
host port: 3306
character set server: 'utf8mb4'
collation server: 'utf8mb4_unicode_ci'
mysql database: 'evennia'
@ -72,10 +71,10 @@ jobs:
- name: Install extra dependencies
run: pip install -r requirements_extra.txt
- name: Install and initialize evennia
- name: Initialize evennia
run: |
evennia --init testing_mygame
cp .travis/${{ matrix.TESTING_DB }}_settings.py testing_mygame/server/conf/settings.py
cp .github/workflows/${{ matrix.TESTING_DB }}_settings.py testing_mygame/server/conf/settings.py
cd testing_mygame
evennia migrate
evennia collectstatic --noinput
@ -86,18 +85,21 @@ jobs:
coverage run --source=../evennia --omit=*/migrations/*,*/urls.py,*/test*.py,*.sh,*.txt,*.md,*.pyc,*.service ../bin/unix/evennia test --settings=settings --keepdb evennia
coverage xml
# we only want to run coverall once, so we only do it for one of the matrix combinations
# we only want to run coverall/codacy once, so we only do it for one of the matrix combinations
# it's also not critical if pushing to either service fails (happens for PRs since env is not
# available outside of the evennia org)
- name: Send data to Coveralls
if: ${{ matrix.TESTING_DB == 'sqlite3' && matrix.python-version == 3.7 }}
continue-on-error: true
continue-on-error: true
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
cd testing_mygame
coveralls
- name: Send data to Codacy
if: ${{ matrix.TESTING_DB == 'sqlite3' && matrix.python-version == 3.7 }}
continue-on-error: true
continue-on-error: true
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}

70
.github/workflows/mysql_settings.py vendored Normal file
View file

@ -0,0 +1,70 @@
"""
Evennia settings file.
The available options are found in the default settings file found
here:
/home/griatch/Devel/Home/evennia/evennia/evennia/settings_default.py
Remember:
Don't copy more from the default file than you actually intend to
change; this will make sure that you don't overload upstream updates
unnecessarily.
When changing a setting requiring a file system path (like
path/to/actual/file.py), use GAME_DIR and EVENNIA_DIR to reference
your game folder and the Evennia library folders respectively. Python
paths (path.to.module) should be given relative to the game's root
folder (typeclasses.foo) whereas paths within the Evennia library
needs to be given explicitly (evennia.foo).
If you want to share your game dir, including its settings, you can
put secret game- or server-specific settings in secret_settings.py.
"""
import os
# Use the defaults from Evennia unless explicitly overridden
from evennia.settings_default import *
######################################################################
# Evennia base server config
######################################################################
# This is the name of your game. Make it catchy!
SERVERNAME = "testing_mygame"
# Testing database types
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "evennia",
"USER": "evennia",
"PASSWORD": "password",
"HOST": "127.0.0.1",
"PORT": "", # use default port
"OPTIONS": {
"charset": "utf8mb4",
"init_command": "set collation_connection=utf8mb4_unicode_ci",
},
"TEST": {
"NAME": "evennia",
"OPTIONS": {
"charset": "utf8mb4",
"init_command": "set collation_connection=utf8mb4_unicode_ci",
},
},
}
}
######################################################################
# Settings given in secret_settings.py override those in this file.
######################################################################
try:
from server.conf.secret_settings import *
except ImportError:
print("secret_settings.py file not found or failed to import.")

View file

@ -0,0 +1,60 @@
"""
Evennia settings file.
The available options are found in the default settings file found
here:
/home/griatch/Devel/Home/evennia/evennia/evennia/settings_default.py
Remember:
Don't copy more from the default file than you actually intend to
change; this will make sure that you don't overload upstream updates
unnecessarily.
When changing a setting requiring a file system path (like
path/to/actual/file.py), use GAME_DIR and EVENNIA_DIR to reference
your game folder and the Evennia library folders respectively. Python
paths (path.to.module) should be given relative to the game's root
folder (typeclasses.foo) whereas paths within the Evennia library
needs to be given explicitly (evennia.foo).
If you want to share your game dir, including its settings, you can
put secret game- or server-specific settings in secret_settings.py.
"""
import os
# Use the defaults from Evennia unless explicitly overridden
from evennia.settings_default import *
######################################################################
# Evennia base server config
######################################################################
# This is the name of your game. Make it catchy!
SERVERNAME = "testing_mygame"
# Testing database types
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "evennia",
"USER": "evennia",
"PASSWORD": "password",
"HOST": "localhost",
"PORT": "", # use default
"TEST": {"NAME": "default"},
}
}
######################################################################
# Settings given in secret_settings.py override those in this file.
######################################################################
try:
from server.conf.secret_settings import *
except ImportError:
print("secret_settings.py file not found or failed to import.")

47
.github/workflows/sqlite3_settings.py vendored Normal file
View file

@ -0,0 +1,47 @@
"""
Evennia settings file.
The available options are found in the default settings file found
here:
/home/griatch/Devel/Home/evennia/evennia/evennia/settings_default.py
Remember:
Don't copy more from the default file than you actually intend to
change; this will make sure that you don't overload upstream updates
unnecessarily.
When changing a setting requiring a file system path (like
path/to/actual/file.py), use GAME_DIR and EVENNIA_DIR to reference
your game folder and the Evennia library folders respectively. Python
paths (path.to.module) should be given relative to the game's root
folder (typeclasses.foo) whereas paths within the Evennia library
needs to be given explicitly (evennia.foo).
If you want to share your game dir, including its settings, you can
put secret game- or server-specific settings in secret_settings.py.
"""
import os
# Use the defaults from Evennia unless explicitly overridden
from evennia.settings_default import *
######################################################################
# Evennia base server config
######################################################################
# This is the name of your game. Make it catchy!
SERVERNAME = "testing_mygame"
# Using default sqlite3 settings
######################################################################
# Settings given in secret_settings.py override those in this file.
######################################################################
try:
from server.conf.secret_settings import *
except ImportError:
print("secret_settings.py file not found or failed to import.")