You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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