tests.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # TODO: Line 47, enable pytest --doctest-modules
  2. name: Tests
  3. on: [push, pull_request]
  4. jobs:
  5. Tests:
  6. strategy:
  7. fail-fast: false
  8. max-parallel: 15
  9. matrix:
  10. node: [10.x, 12.x, 14.x]
  11. python: [3.6, 3.8, 3.9]
  12. os: [macos-latest, ubuntu-latest, windows-latest]
  13. runs-on: ${{ matrix.os }}
  14. steps:
  15. - name: Checkout Repository
  16. uses: actions/checkout@v2
  17. - name: Use Node.js ${{ matrix.node }}
  18. uses: actions/setup-node@v1
  19. with:
  20. node-version: ${{ matrix.node }}
  21. - name: Use Python ${{ matrix.python }}
  22. uses: actions/setup-python@v2
  23. with:
  24. python-version: ${{ matrix.python }}
  25. env:
  26. PYTHON_VERSION: ${{ matrix.python }}
  27. - name: Install Dependencies
  28. run: |
  29. npm install --no-progress
  30. pip install flake8 pytest
  31. - name: Set Windows environment
  32. if: matrix.os == 'windows-latest'
  33. run:
  34. echo '::set-env name=GYP_MSVS_VERSION::2015'
  35. echo '::set-env name=GYP_MSVS_OVERRIDE_PATH::C:\\Dummy'
  36. - name: Lint Python
  37. if: matrix.os == 'ubuntu-latest'
  38. run: |
  39. # stop the build if there are Python syntax errors or undefined names
  40. flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
  41. # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
  42. flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
  43. - name: Run Python tests
  44. run: |
  45. python -m pytest
  46. # - name: Run doctests with pytest
  47. # run: python -m pytest --doctest-modules
  48. - name: Run Node tests
  49. run: |
  50. npm test