lint.yaml 708 B

123456789101112131415161718192021222324252627282930313233
  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: Run Revive Action
  23. uses: docker://morphy/revive-action:v2
  24. with:
  25. config: tools/check/revive.toml
  26. - name: Check formatting
  27. run: test -z $(gofmt -l .) || (gofmt -l . && exit 1)