go.yml 618 B

1234567891011121314151617181920212223242526272829
  1. name: Go
  2. on: [push, pull_request]
  3. jobs:
  4. lint:
  5. runs-on: ubuntu-latest
  6. strategy:
  7. fail-fast: false
  8. matrix:
  9. go-version: [1.18]
  10. steps:
  11. - uses: actions/checkout@v3
  12. - name: Set up Go ${{ matrix.go-version }}
  13. uses: actions/setup-go@v3
  14. with:
  15. go-version: ${{ matrix.go-version }}
  16. - name: Install goimports
  17. run: |
  18. go install golang.org/x/tools/cmd/goimports@latest
  19. export PATH="$HOME/go/bin:$PATH"
  20. - name: Install pre-commit
  21. run: pip install pre-commit
  22. - name: Lint
  23. run: pre-commit run -a