Add golangci-lint config and fix gofmt formatting #23
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: {} | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Go | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version-file: go.mod | |
| # Windows Defender real-time scanning causes significant slowdown for | |
| # I/O-heavy operations (temp file creation, process spawning, etc.) | |
| # See: https://github.com/golang/go/issues/26055 | |
| - name: Disable Windows Defender real-time monitoring | |
| if: runner.os == 'Windows' | |
| shell: powershell | |
| run: Set-MpPreference -DisableRealtimeMonitoring $true | |
| - name: Build | |
| run: go build -v ./... | |
| - name: Test | |
| run: go test -v -race ./... | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Go | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: golangci-lint | |
| run: go tool golangci-lint run ./... |