From 94d7c478ebf9567af68747654027b73762315a7e Mon Sep 17 00:00:00 2001 From: Patryk Osmaczko Date: Mon, 19 Dec 2022 19:55:40 +0100 Subject: [PATCH] feat: introduce nim tests --- Makefile | 5 ++++ ci/Jenkinsfile.tests-nim | 62 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 ci/Jenkinsfile.tests-nim diff --git a/Makefile b/Makefile index 7eff3b7318..ddef04ab49 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,7 @@ BUILD_SYSTEM_DIR := vendor/nimbus-build-system run-linux \ run-macos \ run-windows \ + tests-nim-linux \ status-go \ status-keycard-go \ statusq-sanity-checker \ @@ -642,6 +643,10 @@ run-windows: nim_status_client $(NIM_WINDOWS_PREBUILT_DLLS) PATH="$(shell pwd)"/"$(shell dirname "$(DOTHERSIDE)")":"$(STATUSGO_LIBDIR)":"$(STATUSKEYCARDGO_LIBDIR)":"$(shell pwd)"/"$(shell dirname "$(NIM_WINDOWS_PREBUILT_DLLS)")":"$(PATH)" \ ./bin/nim_status_client.exe +tests-nim-linux: | check-qt-dir + LD_LIBRARY_PATH="$(QT5_LIBDIR)" \ + $(ENV_SCRIPT) nim c $(NIM_PARAMS) $(NIM_EXTRA_PARAMS) -r test/nim/message_model_test.nim + statusq-sanity-checker: cmake -Bui/StatusQ/build -Sui/StatusQ && cmake --build ui/StatusQ/build --target SanityChecker diff --git a/ci/Jenkinsfile.tests-nim b/ci/Jenkinsfile.tests-nim new file mode 100644 index 0000000000..84450c4c45 --- /dev/null +++ b/ci/Jenkinsfile.tests-nim @@ -0,0 +1,62 @@ +library 'status-jenkins-lib@v1.6.3' + +/* Options section can't access functions in objects. */ +def isPRBuild = utils.isPRBuild() + +pipeline { + agent { label 'linux' } + + parameters { + choice( + name: 'VERBOSE', + description: 'Level of verbosity based on nimbus-build-system setup.', + choices: ['0', '1', '2'] + ) + } + + options { + timestamps() + /* Prevent Jenkins jobs from running forever */ + timeout(time: 20, unit: 'MINUTES') + /* manage how many builds we keep */ + buildDiscarder(logRotator( + numToKeepStr: '10', + daysToKeepStr: '30', + artifactNumToKeepStr: '3', + )) + /* Abort old PR builds. */ + disableConcurrentBuilds( + abortPrevious: isPRBuild + ) + } + + environment { + TARGET = 'tests-nim' + /* Improve make performance */ + MAKEFLAGS = "-j4 V=${params.VERBOSE}" + /* Disable colors in Nim compiler logs */ + NIMFLAGS = '--colors:off' + /* Makefile assumes the compiler folder is included */ + QTDIR = "/opt/qt/5.14.2/gcc_64" + /* Include library in order to compile the project */ + LD_LIBRARY_PATH = "$QTDIR/lib" + } + + stages { + stage('Check') { + steps { sh 'make tests-nim-linux' } + } + + stage('Upload') { + steps { script { + env.PKG_URL = "${currentBuild.absoluteUrl}/consoleText" + } } + } + } + + post { + success { script { github.notifyPR(true) } } + failure { script { github.notifyPR(false) } } + cleanup { cleanWs() } + } +}