Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. name: Style check
  2. on:
  3. pull_request:
  4. branches:
  5. - main
  6. concurrency:
  7. group: style-${{ github.head_ref || github.run_id }}
  8. cancel-in-progress: true
  9. jobs:
  10. python-style:
  11. name: Python Style
  12. runs-on: ubuntu-latest
  13. steps:
  14. - name: Checkout code
  15. uses: actions/checkout@v4
  16. with:
  17. fetch-depth: 0
  18. persist-credentials: false
  19. - name: Check changed files
  20. id: changed-files
  21. uses: tj-actions/changed-files@v45
  22. with:
  23. files: |
  24. api/**
  25. .github/workflows/style.yml
  26. - name: Setup UV and Python
  27. if: steps.changed-files.outputs.any_changed == 'true'
  28. uses: ./.github/actions/setup-uv
  29. with:
  30. uv-lockfile: api/uv.lock
  31. enable-cache: false
  32. - name: Install dependencies
  33. if: steps.changed-files.outputs.any_changed == 'true'
  34. run: uv sync --project api --only-group lint
  35. - name: Ruff check
  36. if: steps.changed-files.outputs.any_changed == 'true'
  37. run: |
  38. uv run --directory api ruff --version
  39. uv run --directory api ruff check ./
  40. uv run --directory api ruff format --check ./
  41. - name: Dotenv check
  42. if: steps.changed-files.outputs.any_changed == 'true'
  43. run: uv run --project api dotenv-linter ./api/.env.example ./web/.env.example
  44. - name: Lint hints
  45. if: failure()
  46. run: echo "Please run 'dev/reformat' to fix the fixable linting errors."
  47. web-style:
  48. name: Web Style
  49. runs-on: ubuntu-latest
  50. defaults:
  51. run:
  52. working-directory: ./web
  53. steps:
  54. - name: Checkout code
  55. uses: actions/checkout@v4
  56. with:
  57. fetch-depth: 0
  58. persist-credentials: false
  59. - name: Check changed files
  60. id: changed-files
  61. uses: tj-actions/changed-files@v45
  62. with:
  63. files: web/**
  64. - name: Install pnpm
  65. uses: pnpm/action-setup@v4
  66. with:
  67. version: 10
  68. run_install: false
  69. - name: Setup NodeJS
  70. uses: actions/setup-node@v4
  71. if: steps.changed-files.outputs.any_changed == 'true'
  72. with:
  73. node-version: 22
  74. cache: pnpm
  75. cache-dependency-path: ./web/package.json
  76. - name: Web dependencies
  77. if: steps.changed-files.outputs.any_changed == 'true'
  78. run: pnpm install --frozen-lockfile
  79. - name: Web style check
  80. if: steps.changed-files.outputs.any_changed == 'true'
  81. run: pnpm run lint
  82. docker-compose-template:
  83. name: Docker Compose Template
  84. runs-on: ubuntu-latest
  85. steps:
  86. - name: Checkout code
  87. uses: actions/checkout@v4
  88. with:
  89. fetch-depth: 0
  90. persist-credentials: false
  91. - name: Check changed files
  92. id: changed-files
  93. uses: tj-actions/changed-files@v45
  94. with:
  95. files: |
  96. docker/generate_docker_compose
  97. docker/.env.example
  98. docker/docker-compose-template.yaml
  99. docker/docker-compose.yaml
  100. - name: Generate Docker Compose
  101. if: steps.changed-files.outputs.any_changed == 'true'
  102. run: |
  103. cd docker
  104. ./generate_docker_compose
  105. - name: Check for changes
  106. if: steps.changed-files.outputs.any_changed == 'true'
  107. run: git diff --exit-code
  108. superlinter:
  109. name: SuperLinter
  110. runs-on: ubuntu-latest
  111. steps:
  112. - name: Checkout code
  113. uses: actions/checkout@v4
  114. with:
  115. fetch-depth: 0
  116. persist-credentials: false
  117. - name: Check changed files
  118. id: changed-files
  119. uses: tj-actions/changed-files@v45
  120. with:
  121. files: |
  122. **.sh
  123. **.yaml
  124. **.yml
  125. **Dockerfile
  126. dev/**
  127. - name: Super-linter
  128. uses: super-linter/super-linter/slim@v7
  129. if: steps.changed-files.outputs.any_changed == 'true'
  130. env:
  131. BASH_SEVERITY: warning
  132. DEFAULT_BRANCH: main
  133. FILTER_REGEX_INCLUDE: pnpm-lock.yaml
  134. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  135. IGNORE_GENERATED_FILES: true
  136. IGNORE_GITIGNORED_FILES: true
  137. VALIDATE_BASH: true
  138. VALIDATE_BASH_EXEC: true
  139. # FIXME: temporarily disabled until api-docker.yaml's run script is fixed for shellcheck
  140. # VALIDATE_GITHUB_ACTIONS: true
  141. VALIDATE_DOCKERFILE_HADOLINT: true
  142. VALIDATE_XML: true
  143. VALIDATE_YAML: true