mirror of https://github.com/status-im/go-waku.git
ci: add Jenkinsfile that runs lint and test targets
This adds a simple `Jenkinsfile` that runs `make lint` and `make test`. Had to also add a `deps` target that runs `lint-install` to install missing `golangci-lint`. Jobs folder: https://ci.status.im/job/go-waku/ Resolves: https://github.com/status-im/go-waku/issues/11 Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
afc8ed6e85
commit
e10778c432
|
@ -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() }
|
||||||
|
}
|
||||||
|
}
|
7
Makefile
7
Makefile
|
@ -2,12 +2,17 @@
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
|
deps: lint-install
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build -o build/waku waku.go
|
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:
|
lint:
|
||||||
@echo "lint"
|
@echo "lint"
|
||||||
@golangci-lint --exclude=SA1019 run ./... --deadline=5m
|
@golangci-lint --exclude=SA1019 run ./... --deadline=5m
|
||||||
test:
|
test:
|
||||||
go test -v -failfast ./...
|
go test -v -failfast ./...
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue