lint.yaml 944 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. name: Lint
  2. on:
  3. pull_request:
  4. types: [opened, edited, synchronize, reopened]
  5. paths:
  6. - '**.go'
  7. - 'go.mod'
  8. - 'go.sum'
  9. - 'tools/check/revive.toml'
  10. - '.github/workflows/lint.yaml'
  11. jobs:
  12. lint:
  13. name: Lint
  14. runs-on: ubuntu-latest
  15. steps:
  16. - name: Set up Go
  17. uses: actions/setup-go@v4
  18. with:
  19. go-version: '1.20'
  20. - name: Check out code into the Go module directory
  21. uses: actions/checkout@v3
  22. - name: Check licenses
  23. run: |
  24. go install github.com/google/go-licenses@latest
  25. $(go env GOPATH)/bin/go-licenses check ./... --disallowed_types forbidden,restricted,unknown --ignore modernc.org/mathutil
  26. - name: Run Revive Action
  27. uses: docker://morphy/revive-action:v2
  28. with:
  29. config: tools/check/revive.toml
  30. - name: Check formatting
  31. run: test -z $(gofmt -l .) || (gofmt -l . && exit 1)