python-app.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # This workflow will install Python dependencies, run tests and lint with a single version of Python
  2. # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
  3. name: Python application
  4. on:
  5. push:
  6. branches: [ main ]
  7. pull_request:
  8. branches: [ main ]
  9. jobs:
  10. build:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v2
  14. - name: Set up Python 3.10
  15. uses: actions/setup-python@v2
  16. with:
  17. python-version: "3.10"
  18. - name: Install dependencies
  19. run: |
  20. python -m pip install --upgrade pip
  21. pip install flake8 pipenv
  22. if [ -f Pipfile ]; then pipenv install --dev; fi
  23. - name: Lint with flake8
  24. run: |
  25. # stop the build if there are Python syntax errors or undefined names
  26. flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
  27. # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
  28. flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
  29. - name: Test with pytest
  30. run: |
  31. pipenv run test