Refactoring of actions
This commit is contained in:
parent
1b8a143998
commit
3e87b85bc6
1 changed files with 11 additions and 30 deletions
41
.github/workflows/pythonpackage.yml
vendored
41
.github/workflows/pythonpackage.yml
vendored
|
|
@ -10,18 +10,18 @@ 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']
|
||||||
fail-fast: False
|
fail-fast: False
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up PostgreSQL server
|
- name: Set up PostgreSQL server
|
||||||
uses: harmon758/postgresql-action@v1
|
uses: harmon758/postgresql-action@v1
|
||||||
|
|
@ -31,17 +31,14 @@ jobs:
|
||||||
postgresql db: 'evennia'
|
postgresql db: 'evennia'
|
||||||
postgresql user: 'evennia'
|
postgresql user: 'evennia'
|
||||||
postgresql password: 'password'
|
postgresql password: 'password'
|
||||||
- name: Shutdown Ubuntu MySQL
|
|
||||||
if: ${{ matrix.TESTING_DB == 'mysql'}}
|
|
||||||
run: sudo service mysql stop
|
|
||||||
- name: Set up MySQL server
|
- name: Set up MySQL server
|
||||||
uses: mirromutth/mysql-action@v1.1
|
uses: mirromutth/mysql-action@v1.1
|
||||||
if: ${{ matrix.TESTING_DB == 'mysql'}}
|
if: ${{ matrix.TESTING_DB == 'mysql'}}
|
||||||
with:
|
with:
|
||||||
mysql version: '8.0'
|
mysql version: '5.7'
|
||||||
mysql database: 'evennia'
|
|
||||||
character set server: 'utf8mb4'
|
character set server: 'utf8mb4'
|
||||||
collation server: 'utf8mb4_unicode_ci'
|
collation server: 'utf8mb4_unicode_ci'
|
||||||
|
mysql database: 'evennia'
|
||||||
mysql user: 'evennia'
|
mysql user: 'evennia'
|
||||||
mysql password: 'password'
|
mysql password: 'password'
|
||||||
|
|
||||||
|
|
@ -52,26 +49,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
time: '10s'
|
time: '10s'
|
||||||
- name: Database container logs
|
- name: Database container logs
|
||||||
# if: failure()
|
|
||||||
uses: jwalton/gh-docker-logs@v1.0.0
|
uses: jwalton/gh-docker-logs@v1.0.0
|
||||||
- name: Check running containers
|
- name: Check running containers
|
||||||
run: docker ps -a
|
run: docker ps -a
|
||||||
|
|
||||||
# - name: Setup PostgreSQL database
|
|
||||||
# if: ${{ matrix.TESTING_DB == 'postgresql' }}
|
|
||||||
# run: |
|
|
||||||
# psql --version
|
|
||||||
# psql -U postgres -d postgres -h localhost -c "CREATE DATABASE evennia;"
|
|
||||||
# psql -U postgres -d postgres -h localhost -c "CREATE USER evennia WITH PASSWORD 'password';"
|
|
||||||
# psql -U postgres -d postgres -h localhost -c "ALTER USER evennia CREATEDB;"
|
|
||||||
# - name: Setup MySQL database
|
|
||||||
# if: ${{ matrix.TESTING_DB == 'mysql' }}
|
|
||||||
# run: |
|
|
||||||
# mysql --version
|
|
||||||
# mysql -uroot -proot -e "CREATE DATABASE evennia CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
|
|
||||||
# mysql -uroot -proot -e "CREATE USER 'evennia'@'localhost' IDENTIFIED BY 'password';"
|
|
||||||
# mysql -uroot -proot -e "GRANT ALL ON *.* TO 'evennia'@'localhost' IDENTIFIED BY 'password';"
|
|
||||||
#
|
|
||||||
- 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:
|
||||||
|
|
@ -80,7 +61,7 @@ jobs:
|
||||||
- name: Install package dependencies
|
- name: Install package dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install wheel
|
pip install wheel
|
||||||
pip install psycopg2-binary
|
pip install psycopg2-binary
|
||||||
pip install mysqlclient
|
pip install mysqlclient
|
||||||
pip install coveralls
|
pip install coveralls
|
||||||
|
|
@ -99,9 +80,9 @@ jobs:
|
||||||
evennia migrate
|
evennia migrate
|
||||||
evennia collectstatic --noinput
|
evennia collectstatic --noinput
|
||||||
|
|
||||||
- name: Run test
|
- name: Run test suite
|
||||||
run: |
|
run: |
|
||||||
cd testing_mygame
|
cd testing_mygame
|
||||||
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
|
||||||
coverage xml
|
coverage xml
|
||||||
|
|
||||||
|
|
@ -111,7 +92,7 @@ jobs:
|
||||||
env:
|
env:
|
||||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
cd testing_mygame
|
cd testing_mygame
|
||||||
coveralls
|
coveralls
|
||||||
- name: Send data to Codacy
|
- name: Send data to Codacy
|
||||||
if: ${{ matrix.TESTING_DB == 'sqlite3' && matrix.python-version == 3.7 }}
|
if: ${{ matrix.TESTING_DB == 'sqlite3' && matrix.python-version == 3.7 }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue