2023-06-29 13:40:43 +00:00
|
|
|
#!/usr/bin/env groovy
|
2024-02-15 08:18:11 +00:00
|
|
|
library 'status-jenkins-lib@v1.8.7'
|
2022-08-26 13:18:45 +00:00
|
|
|
|
|
|
|
/* Options section can't access functions in objects. */
|
|
|
|
def isPRBuild = utils.isPRBuild()
|
|
|
|
|
|
|
|
pipeline {
|
2024-02-07 10:44:43 +00:00
|
|
|
agent { label 'linux && x86_64 && nix-2.19' }
|
2022-08-26 13:18:45 +00:00
|
|
|
|
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
/* Prevent Jenkins jobs from running forever */
|
2023-05-10 09:06:10 +00:00
|
|
|
timeout(time: 15, unit: 'MINUTES')
|
2022-08-26 13:18:45 +00:00
|
|
|
/* Limit builds retained */
|
|
|
|
buildDiscarder(logRotator(
|
|
|
|
numToKeepStr: '10',
|
|
|
|
daysToKeepStr: '20',
|
|
|
|
artifactNumToKeepStr: '10',
|
|
|
|
))
|
|
|
|
/* Abort old PR builds. */
|
|
|
|
disableConcurrentBuilds(
|
|
|
|
abortPrevious: isPRBuild
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
parameters {
|
|
|
|
string(
|
|
|
|
name: 'BUILD_TYPE',
|
|
|
|
description: 'Specify build type. Values: pr / e2e / nightly / release',
|
|
|
|
defaultValue: 'pr',
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
environment {
|
|
|
|
LANG = "en_US.UTF-8"
|
|
|
|
LC_ALL = "en_US.UTF-8"
|
|
|
|
LANGUAGE = "en_US.UTF-8"
|
|
|
|
TARGET = 'tests'
|
|
|
|
BUILD_ENV = 'prod'
|
|
|
|
NIX_CONF_DIR = "${env.WORKSPACE}/nix"
|
|
|
|
LOG_FILE = utils.pkgFilename(ext: 'log', arch: 'tests')
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
|
|
|
stage('Checks') {
|
|
|
|
parallel {
|
|
|
|
stage('Lint') {
|
2022-09-05 07:06:09 +00:00
|
|
|
steps {
|
|
|
|
sh """#!/bin/bash
|
|
|
|
set -eo pipefail
|
2023-10-04 19:06:54 +00:00
|
|
|
make lint CLJ_LINTER_PRINT_WARNINGS=true 2>&1 | tee ${LOG_FILE}
|
2022-09-05 07:06:09 +00:00
|
|
|
"""
|
|
|
|
}
|
2022-08-26 13:18:45 +00:00
|
|
|
}
|
2024-01-05 18:47:03 +00:00
|
|
|
stage('Unit Tests') {
|
2022-09-05 07:06:09 +00:00
|
|
|
steps {
|
|
|
|
sh """#!/bin/bash
|
|
|
|
set -eo pipefail
|
2024-01-05 18:47:03 +00:00
|
|
|
make test-unit 2>&1 | tee -a ${LOG_FILE}
|
2022-09-05 07:06:09 +00:00
|
|
|
"""
|
|
|
|
}
|
2022-08-26 13:18:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-01-05 18:47:03 +00:00
|
|
|
stage('Integration Tests') {
|
|
|
|
steps {
|
|
|
|
sh """#!/bin/bash
|
|
|
|
set -eo pipefail
|
|
|
|
make test-integration 2>&1 | tee -a ${LOG_FILE}
|
|
|
|
"""
|
|
|
|
}
|
|
|
|
}
|
2023-02-21 05:42:33 +00:00
|
|
|
stage('Component Tests') {
|
|
|
|
steps {
|
|
|
|
sh """#!/bin/bash
|
|
|
|
set -eo pipefail
|
|
|
|
make component-test 2>&1 | tee -a ${LOG_FILE}
|
|
|
|
"""
|
|
|
|
}
|
|
|
|
}
|
2022-08-26 13:18:45 +00:00
|
|
|
stage('Upload') {
|
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
env.PKG_URL = s3.uploadArtifact(LOG_FILE)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
success { script { github.notifyPR(true) } }
|
|
|
|
failure { script { github.notifyPR(false) } }
|
|
|
|
always { sh 'make purge' }
|
|
|
|
}
|
|
|
|
}
|