tests.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. name: Python tests
  2. on:
  3. workflow_dispatch:
  4. pull_request:
  5. paths:
  6. - '**.py'
  7. push:
  8. paths:
  9. - '**.py'
  10. jobs:
  11. tests:
  12. runs-on: ubuntu-latest
  13. strategy:
  14. matrix:
  15. python-version: ['3.12']
  16. steps:
  17. - uses: actions/checkout@v4
  18. with:
  19. fetch-depth: 0
  20. - name: Set up Python ${{ matrix.python-version }}
  21. uses: actions/setup-python@v5
  22. with:
  23. python-version: ${{ matrix.python-version }}
  24. - name: Install dependencies
  25. run: |
  26. python -m pip install --upgrade pip
  27. pip install -r requirements-dev.txt
  28. - name: Full test with pytest
  29. run: pytest --cov=. --cov-config=.coveragerc --cov-report xml:coverage.xml
  30. - name: SonarCloud scan
  31. uses: sonarsource/sonarcloud-github-action@master
  32. if: (github.event.sender.login == github.event.repository.owner.login) && (github.repository == 'make-all/tuya-local') && (github.ref == 'main')
  33. env:
  34. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  35. SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}