ci: use pipefail to actually catch test errors

Because otherwise when piping optput to `tee` the exit code that
affects the result of the whole `sh` call is the last command in the pipe.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-09-05 09:06:09 +02:00
parent bf346147e9
commit 3f47fb6bf6
No known key found for this signature in database
GPG Key ID: 09AA5403E54D9931
1 changed files with 12 additions and 2 deletions

View File

@ -54,10 +54,20 @@ pipeline {
stage('Checks') {
parallel {
stage('Lint') {
steps { sh "make lint 2>&1 | tee ${LOG_FILE}" }
steps {
sh """#!/bin/bash
set -eo pipefail
make lint 2>&1 | tee ${LOG_FILE}
"""
}
}
stage('Tests') {
steps { sh "make test 2>&1 | tee -a ${LOG_FILE}" }
steps {
sh """#!/bin/bash
set -eo pipefail
make test 2>&1 | tee -a ${LOG_FILE}
"""
}
}
}
}