Skip to content

Commit f634d09

Browse files
authored
Create python-package.yml
1 parent 6629ba9 commit f634d09

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/python-package.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
pre-checks:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: [3.9]
18+
19+
steps:
20+
- name: Checkout the repository
21+
uses: actions/checkout@v2
22+
23+
- name: Setup Python
24+
uses: actions/setup-python@v1
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Install package
29+
run: |
30+
pip install flake8==3.7.7
31+
pip install mypy==0.720
32+
pip install black==19.10b0
33+
pip install isort==4.3.21
34+
- name: Run pre-checks
35+
run: |
36+
flake8 fastapi_asyncpg --config=setup.cfg
37+
mypy fastapi_asyncpg/ --ignore-missing-imports
38+
isort -c -rc fastapi_asyncpg/
39+
black -l 80 --check --verbose fastapi_asyncpg
40+
# Job to run tests
41+
tests:
42+
runs-on: ubuntu-latest
43+
# Set environment variables
44+
steps:
45+
- name: Checkout the repository
46+
uses: actions/checkout@v2
47+
48+
- name: Setup Python
49+
uses: actions/setup-python@v1
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
53+
- name: Install the package
54+
run: |
55+
pip install -e .[test]
56+
57+
- name: Run tests
58+
run: |
59+
pytest -rfE --cov=fastapi_asyncpg -s --tb=native -v --cov-report xml --cov-append tests
60+
61+
- name: Upload coverage to Codecov
62+
uses: codecov/codecov-action@v1
63+
with:
64+
file: ./coverage.xml

0 commit comments

Comments
 (0)