linters.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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@v6
  30. with:
  31. args: >
  32. --timeout 10m
  33. --exclude-dirs=tests
  34. --disable errcheck
  35. --enable sqlclosecheck,misspell,gofmt,goimports,whitespace,gocritic
  36. - uses: dominikh/staticcheck-action@v1.3.1
  37. with:
  38. version: "latest"
  39. install-go: false
  40. commitlint:
  41. name: Commit Linter
  42. runs-on: ubuntu-latest
  43. steps:
  44. - uses: actions/checkout@v4
  45. with:
  46. fetch-depth: 0
  47. - name: Setup Node.js
  48. uses: actions/setup-node@v4
  49. with:
  50. node-version: "lts/*"
  51. - name: Install commitlint
  52. run: |
  53. npm install --save-dev @commitlint/config-conventional @commitlint/cli
  54. echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
  55. - name: Validate PR commits
  56. run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose