2022-12-12 19:29:23 +00:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
dockerfile {
|
|
|
|
label 'linux'
|
|
|
|
dir 'ci'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
2023-06-13 08:29:01 +00:00
|
|
|
/* Avoid cache poisoning by other jobs. */
|
|
|
|
GOCACHE = "${env.WORKSPACE_TMP}/go-build"
|
|
|
|
GOPATH = "${env.WORKSPACE_TMP}/go"
|
2022-12-12 19:29:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
options {
|
|
|
|
disableConcurrentBuilds()
|
|
|
|
buildDiscarder(logRotator(
|
|
|
|
numToKeepStr: '20',
|
|
|
|
daysToKeepStr: '30',
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
2023-08-07 15:39:24 +00:00
|
|
|
stage('BuildAndTest') {
|
|
|
|
matrix {
|
|
|
|
axes {
|
|
|
|
axis {
|
|
|
|
name 'FEATURES'
|
2023-10-02 08:41:08 +00:00
|
|
|
values 'libp2p'
|
2023-08-07 15:39:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Check') {
|
|
|
|
steps {
|
2023-08-09 05:42:08 +00:00
|
|
|
sh "cargo check --all --no-default-features --features ${FEATURES}"
|
2023-08-07 15:39:24 +00:00
|
|
|
sh "cargo fmt -- --check"
|
2023-08-09 05:42:08 +00:00
|
|
|
sh "cargo clippy --all --no-default-features --features ${FEATURES} -- --deny warnings"
|
2023-08-07 15:39:24 +00:00
|
|
|
}
|
|
|
|
}
|
2022-12-12 19:29:23 +00:00
|
|
|
|
2023-08-09 05:42:08 +00:00
|
|
|
stage('BuildAndTest') {
|
|
|
|
options {
|
2023-08-31 11:35:21 +00:00
|
|
|
lock('sync-linux-${env.GIT_COMMIT}')
|
2023-08-07 15:39:24 +00:00
|
|
|
}
|
2023-08-09 05:42:08 +00:00
|
|
|
stages {
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
|
|
|
sh "cargo build --all --no-default-features --features ${FEATURES}"
|
|
|
|
}
|
|
|
|
}
|
2022-12-12 19:29:23 +00:00
|
|
|
|
2023-08-09 05:42:08 +00:00
|
|
|
stage('Test') {
|
|
|
|
steps {
|
|
|
|
sh "cargo test --all --no-default-features --features ${FEATURES}"
|
|
|
|
}
|
|
|
|
}
|
2023-08-07 15:39:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-12-12 19:29:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
cleanup { cleanWs() }
|
|
|
|
}
|
|
|
|
}
|