-
Notifications
You must be signed in to change notification settings - Fork 12
96 lines (81 loc) · 2.19 KB
/
ci.yml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: ci
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
name: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux_3.9, windows_3.9, mac_3.9]
include:
- build: linux_3.9
os: ubuntu-latest
python: 3.9
- build: windows_3.9
os: windows-latest
python: 3.9
- build: mac_3.9
os: macos-latest
python: 3.9
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt
# test all the builds apart from linux_3.8...
- name: Test with pytest
if: matrix.build != 'linux_3.9'
run: pytest
# only do the test coverage for linux_3.8
- name: Produce coverage report
if: matrix.build == 'linux_3.9'
run: pytest --cov=fastapi_async_sqlalchemy --cov-report=xml
- name: Upload coverage report
if: matrix.build == 'linux_3.9'
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: pip install flake8
- name: Run flake8
run: flake8 --count .
format:
name: format
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
# isort needs all of the packages to be installed so it can
# tell which are third party and which are first party
run: pip install -r requirements.txt
- name: Check formatting of imports
run: isort --check-only --diff --verbose
- name: Check formatting of code
run: black . --check --diff