blob: 4456e3a5c82541d273b2a904638f3c53a2687e19 [file] [log] [blame]
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07001#!/usr/bin/env bash
Davide Pesavento72517b52022-08-13 18:50:55 -04002set -eo pipefail
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -07003
Davide Pesavento72517b52022-08-13 18:50:55 -04004case $(uname) in
5 Linux)
6 if [[ -e /etc/os-release ]]; then
7 source /etc/os-release
8 else
9 source /usr/lib/os-release
10 fi
11 export ID VERSION_ID
12 export ID_LIKE="${ID} ${ID_LIKE} linux"
13 export PATH="${HOME}/.local/bin${PATH:+:}${PATH}"
14 ;;
15 Darwin)
16 # Emulate a subset of os-release(5)
17 export ID=macos
18 export VERSION_ID=$(sw_vers -productVersion)
19 ;;
20esac
21
Davide Pesavento69857c32020-04-05 16:36:26 -040022export CACHE_DIR=${CACHE_DIR:-/tmp}
Davide Pesavento69857c32020-04-05 16:36:26 -040023[[ $JOB_NAME == *"code-coverage" ]] && export DISABLE_ASAN=yes
Davide Pesavento56c68a32020-03-12 19:26:21 -040024
Davide Pesavento4bd4f712019-10-09 01:02:45 -040025for file in .jenkins.d/*; do
Alexander Afanasyev6077b392014-12-11 22:56:23 -080026 [[ -f $file && -x $file ]] || continue
Davide Pesavento4bd4f712019-10-09 01:02:45 -040027
Davide Pesavento8f0028d2021-07-27 20:01:06 -040028 if [[ -n $GITHUB_ACTIONS ]]; then
Davide Pesaventof28a0612021-09-29 23:13:32 -040029 label=$(basename "$file" | sed -E 's/[[:digit:]]+-(.*)\..*/\1/')
Davide Pesavento8f0028d2021-07-27 20:01:06 -040030 echo "::group::${label}"
Davide Pesavento4bd4f712019-10-09 01:02:45 -040031 fi
32
33 echo "\$ $file"
Alexander Afanasyev6077b392014-12-11 22:56:23 -080034 "$file"
Davide Pesavento4bd4f712019-10-09 01:02:45 -040035
Davide Pesavento8f0028d2021-07-27 20:01:06 -040036 if [[ -n $GITHUB_ACTIONS ]]; then
37 echo "::endgroup::"
Davide Pesavento4bd4f712019-10-09 01:02:45 -040038 fi
Alexander Afanasyev4d4e7252014-10-25 12:21:53 -070039done