python-app.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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: Install MariaDB Connector/C
  15. run: |
  16. sudo apt-get update
  17. sudo apt-get install libmariadb3 libmariadb-dev mariadb-server
  18. - name: Set up Python 3.10
  19. uses: actions/setup-python@v2
  20. with:
  21. python-version: "3.10"
  22. - name: Install Python dependencies
  23. run: |
  24. python -m pip install --upgrade pip
  25. pip install flake8 pipenv
  26. if [ -f Pipfile ]; then pipenv install --dev; fi
  27. - name: Lint with flake8
  28. run: |
  29. # stop the build if there are Python syntax errors or undefined names
  30. flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
  31. # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
  32. flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
  33. - name: Test with pytest
  34. run: |
  35. pipenv run test