tests.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. env:
  23. UV_SYSTEM_PYTHON: 1
  24. steps:
  25. - uses: actions/checkout@v4
  26. with:
  27. fetch-depth: 0
  28. - name: Set up Python ${{ matrix.python-version }}
  29. uses: actions/setup-python@v6
  30. with:
  31. python-version: ${{ matrix.python-version }}
  32. - name: Install uv
  33. uses: astral-sh/setup-uv@v7
  34. - name: Install dependencies
  35. run: |
  36. sudo apt-get update
  37. sudo apt-get install libturbojpeg
  38. uv pip install -r requirements-dev.txt
  39. - name: Full test with pytest
  40. run: pytest --cov=custom_components/tuya_local --cov-report term:skip-covered --junit-xml=test-results.xml
  41. - name: Surface results
  42. if: always()
  43. uses: pmeier/pytest-results-action@main
  44. with:
  45. path: test-results.xml
  46. summary: true
  47. display-options: fEX
  48. fail-on-empty: true
  49. title: Test results