Update rockylinux Docker tag to v9 #186
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 and Format | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: Lint and Format Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.26' | |
| cache: true | |
| - name: Install dependencies | |
| run: | | |
| go mod download | |
| go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest | |
| - name: Run gofmt | |
| run: | | |
| # Check if gofmt reports any formatting issues | |
| if [ -n "$(gofmt -l .)" ]; then | |
| echo "The following files need formatting:" | |
| gofmt -l . | |
| echo "" | |
| echo "Please run 'gofmt -w .' to format your code" | |
| exit 1 | |
| fi | |
| - name: Run go vet | |
| run: go vet ./... | |
| - name: Run golangci-lint | |
| run: golangci-lint run --timeout=5m | |
| - name: Run go mod tidy check | |
| run: | | |
| go mod tidy | |
| if [ -n "$(git status --porcelain)" ]; then | |
| echo "go mod tidy produced changes:" | |
| git diff | |
| echo "" | |
| echo "Please run 'go mod tidy' and commit the changes" | |
| exit 1 | |
| fi |