lint.yaml 849 B

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