Add linters to CI
This commit is contained in:
@@ -1,10 +1,24 @@
|
|||||||
version: 2
|
version: 2
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
validate:
|
||||||
docker:
|
docker:
|
||||||
# specify the version
|
|
||||||
- image: circleci/golang:1.10
|
- image: circleci/golang:1.10
|
||||||
|
working_directory: /go/src/github.com/virtual-kubelet/virtual-kubelet
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run:
|
||||||
|
name: Install linters
|
||||||
|
command: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s v1.10.2 && mv ./bin/* /go/bin/
|
||||||
|
- run:
|
||||||
|
name: Lint
|
||||||
|
command: golangci-lint run --new-from-rev "HEAD~$(git rev-list master.. --count)" ./...
|
||||||
|
- run:
|
||||||
|
name: Dependencies
|
||||||
|
command: scripts/validate/dep.sh
|
||||||
|
|
||||||
|
test:
|
||||||
|
docker:
|
||||||
|
- image: circleci/golang:1.10
|
||||||
working_directory: /go/src/github.com/virtual-kubelet/virtual-kubelet
|
working_directory: /go/src/github.com/virtual-kubelet/virtual-kubelet
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
@@ -15,12 +29,16 @@ jobs:
|
|||||||
echo 'export AZURE_AUTH_LOCATION=${outputPathCredsfile}' >> $BASH_ENV
|
echo 'export AZURE_AUTH_LOCATION=${outputPathCredsfile}' >> $BASH_ENV
|
||||||
- run: |
|
- run: |
|
||||||
echo 'export KUBECONFIG=${outputPathKubeConfigFile}' >> $BASH_ENV
|
echo 'export KUBECONFIG=${outputPathKubeConfigFile}' >> $BASH_ENV
|
||||||
- run:
|
|
||||||
name: Dependencies
|
|
||||||
command: scripts/validate/dep.sh
|
|
||||||
- run:
|
- run:
|
||||||
name: Build
|
name: Build
|
||||||
command: V=1 make build
|
command: V=1 make build
|
||||||
- run:
|
- run:
|
||||||
name: Tests
|
name: Tests
|
||||||
command: V=1 CI=1 SKIP_AWS_E2E=1 make test
|
command: V=1 CI=1 SKIP_AWS_E2E=1 make test
|
||||||
|
|
||||||
|
workflows:
|
||||||
|
version: 2
|
||||||
|
validate_and_test:
|
||||||
|
jobs:
|
||||||
|
- validate
|
||||||
|
- test
|
||||||
|
|||||||
13
.golangci.yml
Normal file
13
.golangci.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
linter-settings:
|
||||||
|
lll:
|
||||||
|
line-length: 200
|
||||||
|
|
||||||
|
linters:
|
||||||
|
disable-all: true
|
||||||
|
enable:
|
||||||
|
- errcheck
|
||||||
|
- govet
|
||||||
|
- ineffassign
|
||||||
|
- golint
|
||||||
|
- goconst
|
||||||
|
- goimports
|
||||||
Reference in New Issue
Block a user