-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (54 loc) · 1.55 KB
/
test-build.yaml
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
name: Continuous Integration
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
paths-ignore:
- "docs/**"
- "**.md"
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
echo "Current directory $PWD"; curl -sSL https://install.python-poetry.org/ | python -
poetry install ; pip install -e .
python3 -m pip install types-pytz
python3 -m pip install types-requests
- name: Install pytest
run: |
pip install pytest
- name: Run tests
run: |
poetry run pytest wenling/tests
- name: Install lint dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 mypy==1.1.1 isort black==23.12.0
- name: Run black
run: |
black --check .
- name: Run Flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run mypy
run: |
mypy . --exclude '(wenling/tests/*|examples/*)'
- name: Run isort
run: |
isort --check --diff .