4
0

linters.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. name: Linters
  2. permissions: read-all
  3. on:
  4. pull_request:
  5. branches:
  6. - main
  7. workflow_dispatch:
  8. jobs:
  9. jshint:
  10. name: Javascript Linter
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v4
  14. - name: Install linters
  15. run: |
  16. sudo npm install -g jshint@2.13.6 eslint@8.57.0
  17. - name: Run jshint
  18. run: jshint internal/ui/static/js/*.js
  19. - name: Run ESLint
  20. run: eslint internal/ui/static/js/*.js
  21. golangci:
  22. name: Golang Linters
  23. runs-on: ubuntu-latest
  24. steps:
  25. - uses: actions/checkout@v4
  26. - uses: actions/setup-go@v5
  27. with:
  28. go-version: "1.24.x"
  29. - uses: golangci/golangci-lint-action@v7
  30. with:
  31. args: >
  32. --timeout 10m
  33. --disable errcheck,staticcheck
  34. --enable sqlclosecheck,misspell,whitespace,gocritic
  35. - uses: dominikh/staticcheck-action@v1.3.1
  36. with:
  37. version: "latest"
  38. install-go: false
  39. commitlint:
  40. name: Commit Linter
  41. runs-on: ubuntu-latest
  42. steps:
  43. - uses: actions/checkout@v4
  44. with:
  45. fetch-depth: 0
  46. - name: Setup Node.js
  47. uses: actions/setup-node@v4
  48. with:
  49. node-version: "lts/*"
  50. - name: Install commitlint
  51. run: |
  52. npm install --save-dev @commitlint/config-conventional @commitlint/cli
  53. echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
  54. - name: Validate PR commits
  55. run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose