You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

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