Dingpf/packaging #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |