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.

style.yml 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. name: Style check
  2. on:
  3. workflow_call:
  4. concurrency:
  5. group: style-${{ github.head_ref || github.run_id }}
  6. cancel-in-progress: true
  7. permissions:
  8. checks: write
  9. statuses: write
  10. contents: read
  11. jobs:
  12. python-style:
  13. name: Python Style
  14. runs-on: ubuntu-latest
  15. steps:
  16. - name: Checkout code
  17. uses: actions/checkout@v4
  18. with:
  19. persist-credentials: false
  20. - name: Check changed files
  21. id: changed-files
  22. uses: tj-actions/changed-files@v46
  23. with:
  24. files: |
  25. api/**
  26. .github/workflows/style.yml
  27. - name: Setup UV and Python
  28. if: steps.changed-files.outputs.any_changed == 'true'
  29. uses: astral-sh/setup-uv@v6
  30. with:
  31. enable-cache: false
  32. python-version: "3.12"
  33. cache-dependency-glob: api/uv.lock
  34. - name: Install dependencies
  35. if: steps.changed-files.outputs.any_changed == 'true'
  36. run: uv sync --project api --dev
  37. - name: Run Basedpyright Checks
  38. if: steps.changed-files.outputs.any_changed == 'true'
  39. run: dev/basedpyright-check
  40. - name: Dotenv check
  41. if: steps.changed-files.outputs.any_changed == 'true'
  42. run: uv run --project api dotenv-linter ./api/.env.example ./web/.env.example
  43. web-style:
  44. name: Web Style
  45. runs-on: ubuntu-latest
  46. defaults:
  47. run:
  48. working-directory: ./web
  49. steps:
  50. - name: Checkout code
  51. uses: actions/checkout@v4
  52. with:
  53. persist-credentials: false
  54. - name: Check changed files
  55. id: changed-files
  56. uses: tj-actions/changed-files@v46
  57. with:
  58. files: web/**
  59. - name: Install pnpm
  60. uses: pnpm/action-setup@v4
  61. with:
  62. package_json_file: web/package.json
  63. run_install: false
  64. - name: Setup NodeJS
  65. uses: actions/setup-node@v4
  66. if: steps.changed-files.outputs.any_changed == 'true'
  67. with:
  68. node-version: 22
  69. cache: pnpm
  70. cache-dependency-path: ./web/package.json
  71. - name: Web dependencies
  72. if: steps.changed-files.outputs.any_changed == 'true'
  73. working-directory: ./web
  74. run: pnpm install --frozen-lockfile
  75. - name: Web style check
  76. if: steps.changed-files.outputs.any_changed == 'true'
  77. working-directory: ./web
  78. run: |
  79. pnpm run lint
  80. pnpm run eslint
  81. docker-compose-template:
  82. name: Docker Compose Template
  83. runs-on: ubuntu-latest
  84. steps:
  85. - name: Checkout code
  86. uses: actions/checkout@v4
  87. with:
  88. persist-credentials: false
  89. - name: Check changed files
  90. id: changed-files
  91. uses: tj-actions/changed-files@v46
  92. with:
  93. files: |
  94. docker/generate_docker_compose
  95. docker/.env.example
  96. docker/docker-compose-template.yaml
  97. docker/docker-compose.yaml
  98. - name: Generate Docker Compose
  99. if: steps.changed-files.outputs.any_changed == 'true'
  100. run: |
  101. cd docker
  102. ./generate_docker_compose
  103. - name: Check for changes
  104. if: steps.changed-files.outputs.any_changed == 'true'
  105. run: git diff --exit-code
  106. superlinter:
  107. name: SuperLinter
  108. runs-on: ubuntu-latest
  109. steps:
  110. - name: Checkout code
  111. uses: actions/checkout@v4
  112. with:
  113. fetch-depth: 0
  114. persist-credentials: false
  115. - name: Check changed files
  116. id: changed-files
  117. uses: tj-actions/changed-files@v46
  118. with:
  119. files: |
  120. **.sh
  121. **.yaml
  122. **.yml
  123. **Dockerfile
  124. dev/**
  125. .editorconfig
  126. - name: Super-linter
  127. uses: super-linter/super-linter/slim@v8
  128. if: steps.changed-files.outputs.any_changed == 'true'
  129. env:
  130. BASH_SEVERITY: warning
  131. DEFAULT_BRANCH: origin/main
  132. EDITORCONFIG_FILE_NAME: editorconfig-checker.json
  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_EDITORCONFIG: true
  143. VALIDATE_XML: true
  144. VALIDATE_YAML: true