Skip to content

danielhasan1

danielhasan1 #98

Workflow file for this run

run-name: ${{ github.actor }}
on: [ push, pull_request ]
jobs:
pytest:
name: Run tests with pytest
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9, '3.10', '3.11' ]
steps:
- name: Setup Test Db
run: |
docker pull danielhasan1/mysql_employees_test_db
docker run -d -p 3307:3306 --name dazzling_wright danielhasan1/mysql_employees_test_db
sleep 20
docker exec dazzling_wright bash setup-data
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -e .[test]
# - name: Run linting (flake8)
# run: |
# flake8 ./fastapi_listing ./tests
# - name: Run linting (isort)
# run: |
# isort --check-only ./fastapi_listing ./tests
- name: Run tests
run: |
set -e
set -x
echo "ENV=${ENV}"
export PYTHONPATH=.
pytest --cov=fastapi_listing --cov=tests --cov-report=term-missing --cov-fail-under=80
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}