tests.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. python -m pip install --upgrade pip
  33. pip install -r requirements-dev.txt
  34. - name: Full test with pytest
  35. run: pytest --cov=custom_components/tuya_local --cov-report term:skip-covered --junit-xml=test-results.xml
  36. - name: Surface results
  37. if: always()
  38. uses: pmeier/pytest-results-action@main
  39. with:
  40. path: test-results.xml
  41. summary: true
  42. display-options: fEX
  43. fail-on-empty: true
  44. title: Test results