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:
markoburcul 2024-11-04 16:46:25 +01:00
parent 2151e02838
commit 1f2931582c
No known key found for this signature in database
GPG Key ID: FC4CD2F9A040D54A
3 changed files with 52 additions and 0 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@
!LICENSE*
!Makefile
!Jenkinsfile
nimcache/

50
Jenkinsfile vendored Normal file
View File

@ -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() }
}
}

View File

@ -24,6 +24,7 @@
git pkg-config openssl lsb-release
# Build
rustc cargo nimble gcc11 cmake nim-unwrapped-1
which
# Libraries
gmp llvmPackages.openmp
# Tests