2022-12-12 19:29:23 +00:00
|
|
|
library 'status-jenkins-lib@v1.6.0'
|
|
|
|
|
|
|
|
pipeline {
|
|
|
|
agent {
|
2023-06-13 08:29:01 +00:00
|
|
|
label 'macos && aarch64 && nix-2.11'
|
2022-12-12 19:29:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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 { script {
|
2023-08-09 05:42:08 +00:00
|
|
|
nix.shell("cargo check --all --no-default-features --features ${FEATURES}")
|
2023-08-07 15:39:24 +00:00
|
|
|
nix.shell("cargo fmt -- --check")
|
2023-08-09 05:42:08 +00:00
|
|
|
nix.shell("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-macos-${env.GIT_COMMIT}')
|
2023-08-09 05:42:08 +00:00
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Build') {
|
|
|
|
steps { script {
|
|
|
|
nix.shell("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 { script {
|
|
|
|
nix.shell("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() }
|
|
|
|
}
|
|
|
|
}
|