-
Notifications
You must be signed in to change notification settings - Fork 14
/
Jenkinsfile
122 lines (105 loc) · 3.29 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// 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 'pr' }
options {
timestamps()
timeout(time: 2, unit: 'HOURS')
disableConcurrentBuilds(abortPrevious: true)
}
environment {
CC = 'gcc'
CXX = 'g++'
PATH = "${env.HOME}/.cargo/bin:${env.PATH}"
}
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('Checkout code') {
steps {
sh 'git submodule update --init --recursive'
}
}
stage('Check License headers') {
steps {
sh 'cd scripts/license && ./add_license_header.sh --check'
}
}
stage('Check Go sources formatting') {
steps {
sh "gofmt -s -d go"
}
}
stage('Lint Go sources') {
steps {
withEnv(["PATH+GOPATH=${env.HOME}/go/bin"]) {
sh 'make lint-go'
}
}
}
stage('Check C++ sources formatting') {
steps {
sh 'find cpp/ -not -path "cpp/build/*" \\( -iname *.h -o -iname *.cc \\) | xargs clang-format --dry-run -Werror'
}
}
stage('Build Go') {
steps {
sh 'make tosca-go'
}
}
stage('Run Go tests') {
steps {
sh 'make test-go'
}
}
stage('CT regression tests LFVM') {
steps {
sh 'go run ./go/ct/driver regressions lfvm'
}
}
stage('CT regression tests evmzero') {
steps {
sh 'go run ./go/ct/driver regressions evmzero'
}
}
stage('LFVM race condition tests') {
steps {
sh 'GORACE="halt_on_error=1" go test --race ./go/interpreter/lfvm/...'
}
}
stage('Run C++ tests') {
steps {
sh 'make test-cpp'
}
}
stage('Test C++ coverage support') {
steps {
sh 'make tosca-cpp-coverage'
sh 'go test -v -run ^TestDumpCppCoverageData$ ./go/lib/cpp/ --expect-coverage'
}
}
stage('Test Rust coverage support') {
steps {
sh 'make tosca-rust-coverage'
sh 'go test -v -run ^TestDumpRustCoverageData$ ./go/lib/rust/ --expect-coverage'
}
}
}
}