add settings for CI
Browse files- .github/workflows/ci.yaml +45 -0
.github/workflows/ci.yaml
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: CI
|
2 |
+
|
3 |
+
on:
|
4 |
+
push:
|
5 |
+
branches: [main]
|
6 |
+
pull_request:
|
7 |
+
branches: [main]
|
8 |
+
paths-ignore:
|
9 |
+
- 'README.md'
|
10 |
+
|
11 |
+
jobs:
|
12 |
+
test:
|
13 |
+
runs-on: ubuntu-latest
|
14 |
+
strategy:
|
15 |
+
matrix:
|
16 |
+
python-version: ['3.8', '3.9', '3.10']
|
17 |
+
|
18 |
+
steps:
|
19 |
+
- uses: actions/checkout@v2
|
20 |
+
- name: Set up Python ${{ matrix.python-version }}
|
21 |
+
uses: actions/setup-python@v2
|
22 |
+
with:
|
23 |
+
python-version: ${{ matrix.python-version }}
|
24 |
+
|
25 |
+
- name: Install dependencies
|
26 |
+
run: |
|
27 |
+
pip install -U pip setuptools wheel poetry
|
28 |
+
poetry install
|
29 |
+
- name: Format
|
30 |
+
run: |
|
31 |
+
poetry run black --check .
|
32 |
+
- name: Lint
|
33 |
+
run: |
|
34 |
+
poetry run flake8 . --ignore=E501,W503,E203
|
35 |
+
- name: Type check
|
36 |
+
run: |
|
37 |
+
poetry run mypy . \
|
38 |
+
--ignore-missing-imports \
|
39 |
+
--no-strict-optional \
|
40 |
+
--no-site-packages \
|
41 |
+
--cache-dir=/dev/null
|
42 |
+
|
43 |
+
- name: Run tests
|
44 |
+
run: |
|
45 |
+
poetry run pytest --color=yes -rf
|