ci: add jenkinsfile
Define a CI build that will test the build process with system nim compiler on the master branch. Referenced issue: https://github.com/codex-storage/nim-codex/issues/940 Signed-off-by: markoburcul <marko@status.im>
This commit is contained in:
parent
2151e02838
commit
1f2931582c
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
!LICENSE*
|
!LICENSE*
|
||||||
!Makefile
|
!Makefile
|
||||||
|
!Jenkinsfile
|
||||||
|
|
||||||
nimcache/
|
nimcache/
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
#!/usr/bin/env groovy
|
||||||
|
library 'status-jenkins-lib@v1.9.13'
|
||||||
|
|
||||||
|
pipeline {
|
||||||
|
agent { label 'linux' }
|
||||||
|
|
||||||
|
options {
|
||||||
|
disableConcurrentBuilds()
|
||||||
|
/* manage how many builds we keep */
|
||||||
|
buildDiscarder(logRotator(
|
||||||
|
numToKeepStr: '20',
|
||||||
|
daysToKeepStr: '30',
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
parameters {
|
||||||
|
choice(
|
||||||
|
name: 'VERBOSE',
|
||||||
|
description: 'Level of verbosity based on nimbus-build-system setup.',
|
||||||
|
choices: ['0', '1', '2']
|
||||||
|
)
|
||||||
|
choice(
|
||||||
|
name: 'USE_SYSTEM_NIM',
|
||||||
|
description: 'Decides whether to use system Nim compiler provided with Nix or not.',
|
||||||
|
choices: ['0', '1']
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
environment {
|
||||||
|
/* Improve make performance */
|
||||||
|
NUMPROC = "${sh(script: 'nproc', returnStdout: true).trim()}"
|
||||||
|
MAKEFLAGS = "-j${env.NUMPROC} V=${params.VERBOSE}"
|
||||||
|
/* Use system Nim compiler */
|
||||||
|
USE_SYSTEM_NIM = "${params.USE_SYSTEM_NIM}"
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
nix.develop('make', keepEnv: [ 'MAKEFLAGS', 'USE_SYSTEM_NIM' ])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
cleanup { cleanWs() }
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,6 +24,7 @@
|
||||||
git pkg-config openssl lsb-release
|
git pkg-config openssl lsb-release
|
||||||
# Build
|
# Build
|
||||||
rustc cargo nimble gcc11 cmake nim-unwrapped-1
|
rustc cargo nimble gcc11 cmake nim-unwrapped-1
|
||||||
|
which
|
||||||
# Libraries
|
# Libraries
|
||||||
gmp llvmPackages.openmp
|
gmp llvmPackages.openmp
|
||||||
# Tests
|
# Tests
|
||||||
|
|
Loading…
Reference in New Issue