-
Notifications
You must be signed in to change notification settings - Fork 4
56 lines (46 loc) · 1.28 KB
/
CI_python.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
name: Python Code Checks
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
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.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
cd ./hmatools
python -m pip install --use-pep517 -e .
python -m pip install black flake8 pylint mypy pytest
python -m pip install types-seaborn pandas-stubs matplotlib-stubs
- name: Format code with Black
run: |
cd ./hmatools/python
black --check .
- name: Lint with Flake8
run: |
cd ./hmatools/python
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=100 --statistics
- name: Lint with Pylint
run: |
cd ./hmatools/python
pylint .
- name: Type check with Mypy
run: |
cd ./hmatools/python
mypy . --explicit-package-bases
- name: Run tests
run: |
pytest