diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..0f0026a4 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,35 @@ +pipeline { + agent { + label 'linux' + } + + options { + timestamps() + buildDiscarder(logRotator( + numToKeepStr: '10', + daysToKeepStr: '30', + )) + } + + environment { + GOPATH = "${env.HOME}/go" + PATH = "${env.PATH}:${env.GOPATH}/bin" + } + + stages { + stage('Deps') { + steps { sh 'make deps' } + } + + stage('Lint') { + steps { sh 'make lint' } + } + + stage('Test') { + steps { sh 'make test' } + } + } + post { + always { cleanWs() } + } +} diff --git a/Makefile b/Makefile index 58d74210..546d2b82 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,17 @@ all: build +deps: lint-install + build: go build -o build/waku waku.go +lint-install: + curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \ + bash -s -- -b $(shell go env GOPATH)/bin v1.41.1 + lint: @echo "lint" @golangci-lint --exclude=SA1019 run ./... --deadline=5m test: go test -v -failfast ./... -