Updated Readme #514
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Testing | |
on: [push, pull_request] | |
jobs: | |
test: | |
name: Testing | |
runs-on: ubuntu-latest | |
# Service containers to run with `container-job` | |
services: | |
postgres: | |
# Docker Hub image | |
image: postgres | |
# Provide the password for postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: changeme | |
POSTGRES_DB: test | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
mariadb: | |
# Docker Hub image | |
image: mariadb:10 | |
env: | |
MYSQL_DATABASE: test | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
ports: | |
- 13306:3306 | |
# Set health checks to wait until mariadb has started | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install test tools | |
run: pip install tox coverage | |
- name: Run SQLite tests | |
run: tox | |
- name: Run Postgres tests | |
env: | |
DATABASE_URL: postgres://postgres:changeme@localhost:5432/test | |
run: tox | |
- name: Run MariaDB tests | |
env: | |
DATABASE_URL: mysql://root:@127.0.0.1:13306/test | |
run: | | |
/usr/bin/mysql --host=127.0.0.1 --port=13306 --user=root --execute "SHOW DATABASES;" | |
tox | |
- name: Coverage report | |
run: | | |
coverage report -m | |
coverage lcov -o ./coverage/lcov.info | |
- name: Coveralls Parallel | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.github_token }} | |
flag-name: run-${{ matrix.test_number }} | |
parallel: true | |
public-coveralls: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Publish to Coveralls.io | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.github_token }} | |
parallel-finished: true |