Create test-package.yml
This commit is contained in:
58
.github/workflows/test-package.yml
vendored
Normal file
58
.github/workflows/test-package.yml
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
||||
|
||||
name: Python application
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: "Python ${{ matrix.python-version }}"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.6, 3.7, 3.8]
|
||||
fail-fast: false
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
env:
|
||||
MYSQL_USER: username
|
||||
MYSQL_PASSWORD: password
|
||||
MYSQL_ROOT_PASSWORD: password
|
||||
MYSQL_DATABASE: testsuite
|
||||
ports:
|
||||
- 3306:3306
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
|
||||
postgres:
|
||||
image: postgres:10.8
|
||||
env:
|
||||
POSTGRES_USER: username
|
||||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_DB: testsuite
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
- run: bash DATABASE_URL=sqlite:///testsuite.db scripts/test.sh
|
||||
- run: bash DATABASE_URL=mysql://username:password@localhost:3306/testsuite scripts/test.sh
|
||||
- run: bash DATABASE_URL=postgresql://username:password@localhost:5432/testsuite scripts/test.sh
|
||||
- run: mypy --config-file mypy.ini ormar tests
|
||||
- name: Upload coverage
|
||||
uses: codecov/codecov-action@v1
|
||||
Reference in New Issue
Block a user