style.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. with:
  35. fetch-depth: 0
  36. - name: Setup NodeJS
  37. uses: actions/setup-node@v4
  38. with:
  39. node-version: 20
  40. cache: yarn
  41. cache-dependency-path: ./web/package.json
  42. - name: Web dependencies
  43. run: |
  44. cd ./web
  45. yarn install --frozen-lockfile
  46. - name: Web style check
  47. run: |
  48. cd ./web
  49. yarn run lint
  50. - name: Super-linter
  51. uses: super-linter/super-linter/slim@v6
  52. env:
  53. BASH_SEVERITY: warning
  54. DEFAULT_BRANCH: main
  55. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  56. IGNORE_GENERATED_FILES: true
  57. IGNORE_GITIGNORED_FILES: true
  58. VALIDATE_BASH: true
  59. VALIDATE_BASH_EXEC: true
  60. VALIDATE_GITHUB_ACTIONS: true
  61. VALIDATE_DOCKERFILE_HADOLINT: true
  62. VALIDATE_YAML: true