lint.yaml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: Lint
  2. concurrency:
  3. group: lint-${{ github.event_name }}-${{ github.ref }}
  4. cancel-in-progress: true
  5. on:
  6. pull_request:
  7. types: [opened, edited, synchronize, reopened]
  8. paths:
  9. - '**.go'
  10. - 'go.mod'
  11. - 'go.sum'
  12. - 'tools/check/.golangci.yaml'
  13. - '.github/workflows/lint.yaml'
  14. jobs:
  15. check_licenses:
  16. runs-on: ubuntu-latest
  17. steps:
  18. - name: Set up Go
  19. uses: actions/setup-go@v4
  20. with:
  21. go-version: '1.20'
  22. - name: Check out code into the Go module directory
  23. uses: actions/checkout@v3
  24. - name: Check licenses
  25. run: |
  26. go install github.com/google/go-licenses@latest
  27. $(go env GOPATH)/bin/go-licenses check ./... --disallowed_types forbidden,restricted,unknown --ignore modernc.org/mathutil
  28. golangci_lint:
  29. runs-on: ubuntu-latest
  30. needs:
  31. - check_licenses
  32. steps:
  33. - name: Set up Go
  34. uses: actions/setup-go@v4
  35. with:
  36. go-version: '1.20'
  37. - name: Check out code into the Go module directory
  38. uses: actions/checkout@v3
  39. - name: Install dependencies
  40. env:
  41. DEBIAN_FRONTEND: noninteractive
  42. run: |
  43. sudo apt-get install -y --no-install-recommends pkg-config libzmq3-dev
  44. - name: golangci-lint
  45. uses: golangci/golangci-lint-action@v3
  46. with:
  47. version: latest
  48. args: --config tools/check/.golangci.yaml