diff --git a/.gitignore b/.gitignore index 1b8885e0..ce7c9f30 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ !LICENSE* !Makefile +!Jenkinsfile nimcache/ diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..6e476f7f --- /dev/null +++ b/Jenkinsfile @@ -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() } + } +} diff --git a/flake.nix b/flake.nix index 8778ca4a..cf4a0ed6 100644 --- a/flake.nix +++ b/flake.nix @@ -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