python-package.yml 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
  2. # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
  3. name: Python package
  4. on: [push, pull_request]
  5. jobs:
  6. build:
  7. runs-on: ubuntu-latest
  8. strategy:
  9. matrix:
  10. python-version: ['3.7', '3.8', '3.9']
  11. steps:
  12. - uses: actions/checkout@v2
  13. - name: Set up Python ${{ matrix.python-version }}
  14. uses: actions/setup-python@v2
  15. with:
  16. python-version: ${{ matrix.python-version }}
  17. - name: Install dependencies
  18. run: |
  19. python -m pip install --upgrade pip
  20. python -m pip install flake8
  21. if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
  22. - name: Lint with flake8
  23. run: |
  24. # stop the build if there are Python syntax errors or undefined names
  25. flake8 . --count --ignore=W503 --select=E,F,W,C --show-source --statistics
  26. flake8 . --count --max-complexity=10 --max-line-length=79 --statistics