Code Review changes group 5 #438
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint | |
| on: [push, pull_request] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-go@v4 | |
| with: | |
| go-mod-file: 'go.mod' | |
| cache: false | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8 | |
| id: lint | |
| with: | |
| version: latest | |
| args: '-c .github/.golangci.yml --output.text.print-linter-name --output.text.print-issued-lines --output.text.colors' | |
| skip-cache: true | |
| - name: Print error message | |
| if: always() && steps.lint.outcome == 'failure' | |
| run: | | |
| echo ' | |
| Linting failed. On your local machine, please run | |
| golangci-lint run -c .github/.golangci.yml --fix | |
| and check in the changes.' | |
| exit 1 | |
| staticcheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-go@v4 | |
| with: | |
| go-mod-file: 'go.mod' | |
| - name: Install staticcheck | |
| # Use @master because of staticcheck tool versioning issues, for example: | |
| # "module requires at least go1.24.6, but Staticcheck was built with go1.24.5 (compile)" | |
| run: | | |
| go install honnef.co/go/tools/cmd/staticcheck@master | |
| - name: Run checks | |
| run: | | |
| staticcheck ./... |