blob: 1a12b6cb3b83e676844c8f4589ebb06c5a904f19 [file] [log] [blame]
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07001#!/usr/bin/env bash
2set -e
Davide Pesavento69857c32020-04-05 16:36:26 -04003source .jenkins.d/util.sh
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07004
Davide Pesavento69857c32020-04-05 16:36:26 -04005export CACHE_DIR=${CACHE_DIR:-/tmp}
Davide Pesavento56c68a32020-03-12 19:26:21 -04006export WAF_JOBS=${WAF_JOBS:-1}
Davide Pesavento69857c32020-04-05 16:36:26 -04007[[ $JOB_NAME == *"code-coverage" ]] && export DISABLE_ASAN=yes
Davide Pesavento56c68a32020-03-12 19:26:21 -04008
Davide Pesavento4bd4f712019-10-09 01:02:45 -04009nanos() {
10 # Cannot use date(1) because macOS does not support %N format specifier
Davide Pesavento69857c32020-04-05 16:36:26 -040011 python3 -c 'import time; print(int(time.time() * 1e9))'
Davide Pesavento4bd4f712019-10-09 01:02:45 -040012}
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070013
Davide Pesavento4bd4f712019-10-09 01:02:45 -040014for file in .jenkins.d/*; do
Alexander Afanasyev6077b392014-12-11 22:56:23 -080015 [[ -f $file && -x $file ]] || continue
Davide Pesavento4bd4f712019-10-09 01:02:45 -040016
Davide Pesavento8f0028d2021-07-27 20:01:06 -040017 label=$(basename "$file" | sed -E 's/[[:digit:]]+-(.*)\..*/\1/')
18 if [[ -n $GITHUB_ACTIONS ]]; then
19 echo "::group::${label}"
20 elif [[ -n $TRAVIS ]]; then
Davide Pesavento4bd4f712019-10-09 01:02:45 -040021 echo -ne "travis_fold:start:${label}\r"
22 echo -ne "travis_time:start:${label}\r"
23 start=$(nanos)
24 fi
25
26 echo "\$ $file"
Alexander Afanasyev6077b392014-12-11 22:56:23 -080027 "$file"
Davide Pesavento4bd4f712019-10-09 01:02:45 -040028
Davide Pesavento8f0028d2021-07-27 20:01:06 -040029 if [[ -n $GITHUB_ACTIONS ]]; then
30 echo "::endgroup::"
31 elif [[ -n $TRAVIS ]]; then
Davide Pesavento4bd4f712019-10-09 01:02:45 -040032 finish=$(nanos)
33 echo -ne "travis_time:end:${label}:start=${start},finish=${finish},duration=$((finish-start)),event=${label}\r"
34 echo -ne "travis_fold:end:${label}\r"
35 fi
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070036done