-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (42 loc) · 1.41 KB
/
tests.yml
File metadata and controls
45 lines (42 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
run-name: ${{ github.actor }}
on: [ push, pull_request ]
jobs:
pytest:
name: Run tests with pytest
runs-on: ubuntu-22.04
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@v5
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 }}