Update pythonpackage.yml
This commit is contained in:
parent
8873f1f313
commit
e288fc09a5
1 changed files with 15 additions and 19 deletions
28
.github/workflows/pythonpackage.yml
vendored
28
.github/workflows/pythonpackage.yml
vendored
|
|
@ -11,39 +11,30 @@ on:
|
||||||
|
|
||||||
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
|
||||||
|
if: ${{ matrix.TESTING_DB }} == 'postgresql'
|
||||||
run: |
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue