Skip to content

requirements: only app requirements.txt #78

requirements: only app requirements.txt

requirements: only app requirements.txt #78

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Testing
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black flake8 isort mypy pylint pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8, mypy, pylint, isort and black
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# check also with pylint
pylint $(git ls-files '*.py') --ignore=conf.py
# mypy
mypy src
# isort
isort --check-only --recursive --quiet .
# black
black --check .
- name: Test with pytest
run: |
pytest --cov --cov-report=xml
- name: Test & publish code coverage
# https://github.com/marketplace/actions/code-climate-coverage-action
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: 495554b5189c33d77f3404148524a617700107caa4fb990963753099aa3fc86c