linters.yaml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. name: Linters
  2. on:
  3. push:
  4. tags:
  5. - v*
  6. branches:
  7. - master
  8. - release-*
  9. pull_request:
  10. branches:
  11. - master
  12. - release-*
  13. # cancel the in-progress workflow when PR is refreshed.
  14. concurrency:
  15. group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
  16. cancel-in-progress: true
  17. permissions:
  18. contents: read
  19. jobs:
  20. yaml-linter:
  21. runs-on: ubuntu-latest
  22. steps:
  23. - uses: actions/checkout@v4
  24. with:
  25. fetch-depth: 0
  26. - name: Set up Python
  27. uses: actions/setup-python@v4
  28. with:
  29. python-version: 3.9
  30. - name: Install yamllint
  31. run: pip install yamllint
  32. - name: Lint YAML files
  33. run: yamllint -c .github/workflows/.yamllint deploy/examples/ --no-warnings
  34. pylint:
  35. runs-on: ubuntu-latest
  36. steps:
  37. - uses: actions/checkout@v4
  38. with:
  39. fetch-depth: 0
  40. - name: Set up Python
  41. uses: actions/setup-python@v4
  42. with:
  43. python-version: 3.9
  44. - name: Install pylint and requirements
  45. run: |
  46. pip install pylint
  47. pip install pylint --upgrade
  48. pip install requests
  49. pip install pygit2
  50. - name: Lint Python files
  51. run: pylint $(git ls-files '*.py') -E
  52. - name: Setup black for py
  53. uses: psf/black@stable