tests.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. name: Python tests
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. paths:
  6. - '**.py'
  7. - 'requirements-dev.txt'
  8. push:
  9. paths:
  10. - '**.py'
  11. - 'requirements-dev.txt'
  12. jobs:
  13. tests:
  14. runs-on: ubuntu-latest
  15. permissions:
  16. checks: write
  17. contents: read
  18. pull-requests: write
  19. strategy:
  20. matrix:
  21. python-version: ['3.13']
  22. steps:
  23. - uses: actions/checkout@v4
  24. with:
  25. fetch-depth: 0
  26. - name: Set up Python ${{ matrix.python-version }}
  27. uses: actions/setup-python@v5
  28. with:
  29. python-version: ${{ matrix.python-version }}
  30. - name: Install dependencies
  31. run: |
  32. sudo apt-get update
  33. sudo apt-get install libturbojpeg
  34. python -m pip install --upgrade pip
  35. pip install -r requirements-dev.txt
  36. - name: Full test with pytest
  37. run: pytest --cov=custom_components/tuya_local --cov-report term:skip-covered --junit-xml=test-results.xml
  38. - name: Surface results
  39. if: always()
  40. uses: pmeier/pytest-results-action@main
  41. with:
  42. path: test-results.xml
  43. summary: true
  44. display-options: fEX
  45. fail-on-empty: true
  46. title: Test results