style.yml 1.7 KB

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