CircleCI: Reduce memory usage of golangci-lint (#22970)

* CircleCI: Fix golangci-lint OOM by reducing concurrency and tweaking GC
This commit is contained in:
Arve Knudsen 2020-03-23 17:33:06 +01:00 committed by GitHub
parent d8b346f441
commit a43e31fbf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -714,12 +714,23 @@ jobs:
environment:
# we need CGO because of go-sqlite3
CGO_ENABLED: 1
# Reduce golangci-lint memory usage (default is 100)
GOGC: 20
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
- run:
name: Lint Go
command: "make lint-go"
command: |
# Build linters
make scripts/go/bin/golangci-lint scripts/go/bin/revive scripts/go/bin/gosec
go vet ./pkg/...
# Avoid golangci-lint concurrency since it tends to run out of memory
./scripts/go/bin/golangci-lint run --config scripts/go/configs/.golangci.yml -j 1 ./pkg/...
./scripts/go/bin/revive -formatter stylish -config ./scripts/go/configs/revive.toml ./pkg/...
./scripts/go/bin/revive -formatter stylish ./pkg/services/alerting/...
./scripts/go/bin/gosec -quiet -exclude=G104,G107,G108,G201,G202,G204,G301,G304,G401,G402,G501 \
-conf=./scripts/go/configs/gosec.json ./pkg/...
test-frontend:
docker: