blob: 1a12b6cb3b83e676844c8f4589ebb06c5a904f19 [file] [log] [blame]
Junxiao Shi439d9722015-03-20 15:08:44 -07001#!/usr/bin/env bash
2set -e
Davide Pesaventod8398822020-03-29 18:46:19 -04003source .jenkins.d/util.sh
Junxiao Shi439d9722015-03-20 15:08:44 -07004
Davide Pesaventod8398822020-03-29 18:46:19 -04005export CACHE_DIR=${CACHE_DIR:-/tmp}
Davide Pesaventoa1a9d702020-03-29 00:58:15 -04006export WAF_JOBS=${WAF_JOBS:-1}
Davide Pesaventod5c24472020-04-01 17:46:18 -04007[[ $JOB_NAME == *"code-coverage" ]] && export DISABLE_ASAN=yes
Davide Pesaventoa1a9d702020-03-29 00:58:15 -04008
Davide Pesaventocbef7b82019-10-09 00:15:13 -04009nanos() {
10 # Cannot use date(1) because macOS does not support %N format specifier
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040011 python3 -c 'import time; print(int(time.time() * 1e9))'
Davide Pesaventocbef7b82019-10-09 00:15:13 -040012}
Junxiao Shi439d9722015-03-20 15:08:44 -070013
Davide Pesaventocbef7b82019-10-09 00:15:13 -040014for file in .jenkins.d/*; do
Junxiao Shi439d9722015-03-20 15:08:44 -070015 [[ -f $file && -x $file ]] || continue
Davide Pesaventocbef7b82019-10-09 00:15:13 -040016
Davide Pesaventoe8c82ef2021-07-28 02:38:51 -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 Pesaventocbef7b82019-10-09 00:15:13 -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"
Junxiao Shi439d9722015-03-20 15:08:44 -070027 "$file"
Davide Pesaventocbef7b82019-10-09 00:15:13 -040028
Davide Pesaventoe8c82ef2021-07-28 02:38:51 -040029 if [[ -n $GITHUB_ACTIONS ]]; then
30 echo "::endgroup::"
31 elif [[ -n $TRAVIS ]]; then
Davide Pesaventocbef7b82019-10-09 00:15:13 -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
Junxiao Shi439d9722015-03-20 15:08:44 -070036done