4
0

tests.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. if: ${{github.event.
  30. run: pytest --cov=. --cov-config=.coveragerc --cov-report xml:coverage.xml
  31. - name: SonarCloud scan
  32. uses: sonarsource/sonarcloud-github-action@master
  33. if: (github.event.sender.login == github.event.repository.owner.login) && (github.repository == 'make-all/tuya-local') && (github.ref == 'main')
  34. env:
  35. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  36. SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}