pythonpackage.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. name: Python package
  2. on: [ push ]
  3. jobs:
  4. build:
  5. runs-on: ubuntu-latest
  6. strategy:
  7. max-parallel: 4
  8. matrix:
  9. python-version: [ 3.8 ]
  10. steps:
  11. - uses: actions/checkout@v2
  12. - name: Set up Python ${{ matrix.python-version }}
  13. uses: actions/setup-python@v2
  14. with:
  15. python-version: ${{ matrix.python-version }}
  16. - name: Install dependencies
  17. run: |
  18. python -m pip install --upgrade pip
  19. pip install -r requirements.txt
  20. pip install -r requirements/requirements_dev.txt
  21. pip install -r requirements/requirements_tests.txt
  22. - name: Install dependencies
  23. run: |
  24. python -m pip install --upgrade pip
  25. pip install flake8 pytest
  26. if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
  27. - name: Install package
  28. run: |
  29. pip install -e .[test]
  30. - name: Lint with flake8
  31. run: |
  32. pip install flake8
  33. # stop the build if there are Python syntax errors or undefined names
  34. flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
  35. # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
  36. flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
  37. - name: Test with pytest
  38. run: |
  39. pytest