41 lines
879 B
Plaintext
41 lines
879 B
Plaintext
|
pipeline {
|
||
|
agent any
|
||
|
tools {
|
||
|
go 'go1.18.5'
|
||
|
}
|
||
|
stages {
|
||
|
stage('Pre Test') {
|
||
|
steps {
|
||
|
echo 'Installing dependencies'
|
||
|
sh 'go version'
|
||
|
sh 'go install golang.org/x/lint/golint@latest'
|
||
|
}
|
||
|
}
|
||
|
|
||
|
stage('Build') {
|
||
|
steps {
|
||
|
echo 'Compiling and building'
|
||
|
sh 'go build'
|
||
|
}
|
||
|
}
|
||
|
|
||
|
stage('Lint') {
|
||
|
steps {
|
||
|
echo 'Running vetting'
|
||
|
sh 'go vet ./...'
|
||
|
echo 'Running linting'
|
||
|
sh 'golint ./...'
|
||
|
}
|
||
|
}
|
||
|
|
||
|
stage('Unit-Test') {
|
||
|
steps {
|
||
|
echo 'Run All unit test'
|
||
|
sh 'go test -cover ./...'
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
post {
|
||
|
}
|
||
|
}
|