-
Notifications
You must be signed in to change notification settings - Fork 9
/
Jenkinsfile
40 lines (35 loc) · 1.07 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
pipeline {
agent { label 'quick' }
options {
timestamps ()
timeout(time: 1, unit: 'HOURS')
}
environment {
GOROOT = '/usr/lib/go-1.21/'
GOMEMLIMIT = "5GiB"
}
stages {
stage('Validate commit') {
steps {
script {
def CHANGE_REPO = sh (script: "basename -s .git `git config --get remote.origin.url`", returnStdout: true).trim()
build job: '/Utils/Validate-Git-Commit', parameters: [
string(name: 'Repo', value: "${CHANGE_REPO}"),
string(name: 'Branch', value: "${env.CHANGE_BRANCH}"),
string(name: 'Commit', value: "${GIT_COMMIT}")
]
}
}
}
stage('Check Go sources formatting') {
steps {
sh 'diff=`gofmt -s -d .`; echo "$diff"; test -z "$diff"'
}
}
stage('Run go tests') {
steps {
sh 'go test ./... -timeout 30m'
}
}
}
}