-
Notifications
You must be signed in to change notification settings - Fork 12
/
Jenkinsfile
92 lines (80 loc) · 2.84 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
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// Copyright (c) 2024 Fantom Foundation
//
// Use of this software is governed by the Business Source License included
// in the LICENSE file and at fantom.foundation/bsl11.
//
// Change Date: 2028-4-16
//
// On the date above, in accordance with the Business Source License, use of
// this software will be governed by the GNU Lesser General Public License v3.
pipeline {
agent { label 'db-small-ssd' }
options {
timestamps ()
timeout(time: 2, unit: 'HOURS')
}
environment {
GOMEMLIMIT = '5GiB'
CC = 'clang-14'
CXX = 'clang++-14'
}
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('Run tests') {
stages {
stage('Check license headers') {
steps {
sh 'cd scripts/license && ./add_license_header.sh --check'
}
}
stage('Check Go sources formatting') {
steps {
sh 'cd go && diff=`gofmt -s -d .` && echo "$diff" && test -z "$diff"'
}
}
stage('Check C++ sources formatting') {
steps {
sh 'find cpp/ -iname *.h -o -iname *.cc | xargs clang-format --dry-run -Werror '
}
}
stage('Build C++ libraries') {
steps {
sh 'git submodule update --init --recursive'
sh 'cd go/lib && ./build_libcarmen.sh'
}
}
stage('Build Go') {
steps {
sh 'cd go && go build -v ./...'
}
}
stage('Run Go tests') {
steps {
sh 'cd go && go test ./... -parallel 1 -timeout 60m'
}
}
stage('Run Mpt Go Stress Test') {
steps {
sh 'cd go && go run ./database/mpt/tool stress-test --num-blocks 2000'
}
}
stage('Run C++ tests') {
steps {
sh 'cd cpp && bazel test --test_output=errors //...'
}
}
}
}
}
}