test.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: Python Test
  2. on:
  3. push:
  4. branches: [ master, development ]
  5. pull_request:
  6. branches: [ master, development ]
  7. jobs:
  8. test:
  9. runs-on: ${{ matrix.os }}
  10. strategy:
  11. matrix:
  12. os: [ubuntu-latest, macos-latest]
  13. python-version: [3.9]
  14. ext: [.sh]
  15. include:
  16. - os: windows-latest
  17. python-version: 3.9
  18. ext: .ps1
  19. steps:
  20. - uses: actions/checkout@v2
  21. - name: Setup Python
  22. uses: actions/setup-python@v2
  23. with:
  24. python-version: ${{ matrix.python-version }}
  25. - name: Install dependencies
  26. run: |
  27. python -m pip install --upgrade pip flake8 pytest pytest-cov
  28. pip install -r requirements.txt
  29. - name: Make configuration for tests
  30. env:
  31. REDDIT_TOKEN: ${{ secrets.REDDIT_TEST_TOKEN }}
  32. run: |
  33. ./devscripts/configure${{ matrix.ext }}
  34. - name: Lint with flake8
  35. run: |
  36. flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
  37. - name: Test with pytest
  38. run: |
  39. pytest -m 'not slow' --verbose --cov=./bdfr/ --cov-report term:skip-covered --cov-report html
  40. - name: Upload coverage report
  41. uses: actions/upload-artifact@v2
  42. with:
  43. name: coverage_report
  44. path: htmlcov/