-
Notifications
You must be signed in to change notification settings - Fork 9
/
CI.jenkinsfile
68 lines (59 loc) · 1.47 KB
/
CI.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Norma CI test norma using "make test"
pipeline {
agent { label 'norma' }
options {
timestamps ()
timeout(time: 3, unit: 'HOURS')
disableConcurrentBuilds(abortPrevious: true)
}
parameters {
string(defaultValue: "main", description: 'Can be either branch name or commit hash.', name: 'NormaVersion')
}
environment {
GOROOT = '/usr/local/go'
}
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('Clone Norma') {
steps {
script {
currentBuild.description = 'Building on ${env.NODE_NAME}'
}
checkout scmGit(
branches: [[name: '${NormaVersion}']],
userRemoteConfigs: [[url: 'https://github.com/Fantom-foundation/Norma.git']]
)
}
}
stage('Check Norma Format') {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
sh 'diff=`${GOROOT}/bin/gofmt -l . | grep -v "client"`; echo "$diff"; test -z "$diff"'
}
}
}
stage('Make Norma') {
steps {
sh 'make clean'
sh 'git submodule update --init --recursive'
sh 'make all'
}
}
stage('Test Norma') {
steps {
sh 'make test'
}
}
}
}