Update pythonpackage.yml

This commit is contained in:
Griatch 2020-05-16 23:26:16 +02:00 committed by GitHub
parent d84c06b0b1
commit 10dae4cefa

View file

@ -10,40 +10,31 @@ on:
branches: [ master, develop ] branches: [ master, develop ]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: [3.7, 3.8] python-version: [3.7, 3.8]
TESTING_DB: [sqlite3, postgresql, mysql] TESTING_DB: [sqlite3, postgresql, mysql]
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Set up databases - name: Set up postgreSQL database
run: | if: ${{ matrix.TESTING_DB }} == 'postgresql'
run: |
psql --version psql --version
sudo service postgresql start
psql -U postgres -c "CREATE DATABASE evennia;" psql -U postgres -c "CREATE DATABASE evennia;"
psql -U postgres -c "CREATE USER evennia WITH PASSWORD 'password';" psql -U postgres -c "CREATE USER evennia WITH PASSWORD 'password';"
psql -U postgres -c "ALTER USER evennia CREATEDB;" psql -U postgres -c "ALTER USER evennia CREATEDB;"
- name: Set up MySQL database
if: ${{ matrix.TESTING_DB }} == 'mysql'
run: |
mysql --version mysql --version
sudo service mysql start
mysql -u root -e "CREATE DATABASE evennia CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" 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 "CREATE USER 'evennia'@'localhost' IDENTIFIED BY 'password';"
mysql -u root -e "GRANT ALL ON *.* TO 'evennia'@'localhost' IDENTIFIED BY 'password';" mysql -u root -e "GRANT ALL ON *.* TO 'evennia'@'localhost' IDENTIFIED BY 'password';"
@ -64,10 +55,15 @@ jobs:
- name: run test - name: run test
run: | run: |
coverage run --source=../evennia --omit=*/migrations/*,*/urls.py,*/test*.py,*.sh,*.txt,*.md,*.pyc,*.service ../bin/unix/evennia test --settings=settings --keepdb evennia coverage run --source=../evennia --omit=*/migrations/*,*/urls.py,*/test*.py,*.sh,*.txt,*.md,*.pyc,*.service ../bin/unix/evennia test --settings=settings --keepdb evennia
coveralls: coveralls:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: install coveralls - name: install coveralls
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip