style.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. name: Style check
  2. on:
  3. pull_request:
  4. branches:
  5. - main
  6. concurrency:
  7. group: dep-${{ 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. - name: Set up Python
  17. uses: actions/setup-python@v5
  18. with:
  19. python-version: '3.10'
  20. - name: Python dependencies
  21. run: pip install ruff dotenv-linter
  22. - name: Ruff check
  23. run: ruff check ./api
  24. - name: Dotenv check
  25. run: dotenv-linter ./api/.env.example ./web/.env.example
  26. - name: Lint hints
  27. if: failure()
  28. run: echo "Please run 'dev/reformat' to fix the fixable linting errors."
  29. test:
  30. name: ESLint and SuperLinter
  31. runs-on: ubuntu-latest
  32. needs: python-style
  33. steps:
  34. - name: Checkout code
  35. uses: actions/checkout@v4
  36. with:
  37. fetch-depth: 0
  38. - name: Setup NodeJS
  39. uses: actions/setup-node@v4
  40. with:
  41. node-version: 20
  42. cache: yarn
  43. cache-dependency-path: ./web/package.json
  44. - name: Web dependencies
  45. run: |
  46. cd ./web
  47. yarn install --frozen-lockfile
  48. - name: Web style check
  49. run: |
  50. cd ./web
  51. yarn run lint
  52. - name: Super-linter
  53. uses: super-linter/super-linter/slim@v6
  54. env:
  55. BASH_SEVERITY: warning
  56. DEFAULT_BRANCH: main
  57. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  58. IGNORE_GENERATED_FILES: true
  59. IGNORE_GITIGNORED_FILES: true
  60. VALIDATE_BASH: true
  61. VALIDATE_BASH_EXEC: true
  62. VALIDATE_GITHUB_ACTIONS: true
  63. VALIDATE_DOCKERFILE_HADOLINT: true
  64. VALIDATE_YAML: true