Create pythonpackage.yml
Test with github actions.
This commit is contained in:
parent
8ba59665b2
commit
93e9cd0a17
1 changed files with 62 additions and 0 deletions
62
.github/workflows/pythonpackage.yml
vendored
Normal file
62
.github/workflows/pythonpackage.yml
vendored
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
# 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
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master, develop ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master, develop ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: [3.5, 3.6, 3.7, 3.8]
|
||||||
|
TESTING_DB: [sqlite3, postgresql, mysql]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
- name: Set up databases
|
||||||
|
run: |
|
||||||
|
psql --version
|
||||||
|
psql -U postgres -c "CREATE DATABASE evennia;"
|
||||||
|
psql -U postgres -c "CREATE USER evennia WITH PASSWORD 'password';"
|
||||||
|
psql -U postgres -c "ALTER USER evennia CREATEDB;"
|
||||||
|
mysql --version
|
||||||
|
mysql -u root -e "CREATE DATABASE evennia CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
|
||||||
|
mysql -u root -e "CREATE USER 'evennia'@'localhost' IDENTIFIED BY 'password';"
|
||||||
|
mysql -u root -e "GRANT ALL ON *.* TO 'evennia'@'localhost' IDENTIFIED BY 'password';"
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install psycopg2-binary
|
||||||
|
pip install mysqlclient
|
||||||
|
pip install coveralls
|
||||||
|
pip install codacy-coverage
|
||||||
|
pip install -e .
|
||||||
|
pip install -r requirements_extra.txt
|
||||||
|
- name: Set up evennia
|
||||||
|
run: |
|
||||||
|
evennia --init testing_mygame
|
||||||
|
cp .travis/${{ matrix.TESTING_DB }}_settings.py testing_mygame/server/conf/settings.py
|
||||||
|
cd testing_mygame
|
||||||
|
evennia migrate
|
||||||
|
evennia collectstatic --noinput
|
||||||
|
- name: run test
|
||||||
|
run: |
|
||||||
|
coverage run --source=../evennia --omit=*/migrations/*,*/urls.py,*/test*.py,*.sh,*.txt,*.md,*.pyc,*.service ../bin/unix/evennia test --settings=settings --keepdb evennia
|
||||||
|
coveralls:
|
||||||
|
steps:
|
||||||
|
- name: upload to coveralls
|
||||||
|
run: |
|
||||||
|
coveralls
|
||||||
|
coverage xml
|
||||||
|
python-codacy-coveraage -r coverage.xml
|
||||||
Loading…
Add table
Add a link
Reference in a new issue