mirror of https://github.com/status-im/go-waku.git
53 lines
1.3 KiB
Plaintext
53 lines
1.3 KiB
Plaintext
library 'status-jenkins-lib@v1.7.0'
|
|
|
|
pipeline {
|
|
agent {
|
|
label 'linux && nix-2.11 && x86_64'
|
|
}
|
|
|
|
options {
|
|
timestamps()
|
|
disableConcurrentBuilds()
|
|
/* Prevent Jenkins jobs from running forever */
|
|
timeout(time: 30, unit: 'MINUTES')
|
|
/* Go requires a certain directory structure */
|
|
checkoutToSubdirectory('src/github.com/waku-org/go-waku')
|
|
buildDiscarder(logRotator(
|
|
numToKeepStr: '10',
|
|
daysToKeepStr: '30',
|
|
))
|
|
}
|
|
|
|
environment {
|
|
TARGET = 'tests'
|
|
REPO = "${env.WORKSPACE}/src/github.com/waku-org/go-waku"
|
|
GOCACHE = "${env.WORKSPACE_TMP}/go-build"
|
|
GOPATH = "${env.WORKSPACE}/go"
|
|
PATH = "${env.PATH}:${env.GOPATH}/bin"
|
|
/* Necesary to avoid cache poisoning by other builds. */
|
|
GOLANGCI_LINT_CACHE = "${env.WORKSPACE_TMP}/golangci-lint"
|
|
}
|
|
|
|
stages {
|
|
stage('Lint') {
|
|
steps { script { dir(env.REPO) {
|
|
nix.develop('make lint', pure: false)
|
|
} } }
|
|
}
|
|
|
|
stage('Test') {
|
|
steps { script { dir(env.REPO) {
|
|
nix.develop('make test-ci', pure: false)
|
|
} } }
|
|
}
|
|
}
|
|
post {
|
|
always { script { /* No artifact but a PKG_URL is necessary. */
|
|
env.PKG_URL = "${currentBuild.absoluteUrl}consoleText"
|
|
} }
|
|
success { script { github.notifyPR(true) } }
|
|
failure { script { github.notifyPR(false) } }
|
|
cleanup { cleanWs() }
|
|
}
|
|
}
|