diff --git a/.github/golangci.yaml b/.github/golangci.yaml new file mode 100644 index 00000000..3cfdf04b --- /dev/null +++ b/.github/golangci.yaml @@ -0,0 +1,28 @@ +run: + timeout: 5m + modules-download-mode: readonly + +output: + format: github-actions + +linters: + enable: + - revive + - errcheck + - unused + - staticcheck + - ineffassign + - govet + - gosimple + - bodyclose + +issues: + exclude-use-default: false + exclude-rules: + - path: /*.go + text: "package-comments: should have a package comment" + linters: + - revive + +severity: + default-severity: error diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml new file mode 100644 index 00000000..1bd77952 --- /dev/null +++ b/.github/workflows/golangci-lint.yaml @@ -0,0 +1,33 @@ +name: golangci-lint +on: + push: + branches: + - "!release" + pull_request: + +permissions: + contents: read + +jobs: + golangci: + strategy: + matrix: + go: [ + "diode-sdk-go", + "diode-server", + ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + cache: false + - name: golangci-lint ${{ matrix.go }} + uses: golangci/golangci-lint-action@v3 + with: + version: v1.54 + working-directory: ${{ matrix.go }} + args: --config ../.github/golangci.yaml + skip-pkg-cache: true + skip-build-cache: true