Skip to content

Commit 2df6ad6

Browse files
committed
Detect and report invalid predefined lists
1 parent d66390a commit 2df6ad6

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

run-ib-pr-matrix.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,27 @@ if [ "${CHECK_WORKFLOWS}" = "true" ] ; then
2626
ALL_WFS=$(runTheMatrix.py -n ${OPTS} ${MATRIX_ARGS} | grep -v ' workflows ' | grep '^[1-9][0-9]*\(.[0-9][0-9]*\|\)\s' | sed 's| .*||' | tr '\n' ',' | sed 's|,$||')
2727
WORKFLOWS=$(echo "${WORKFLOWS}" | sed "s|all|${ALL_WFS}|")
2828
fi
29-
runTheMatrix.py -n ${OPTS} ${MATRIX_ARGS} ${WORKFLOWS} | grep -v ' workflows ' | grep '^[1-9][0-9]*\(.[0-9][0-9]*\|\)\s' | sed 's| .*||' > $WORKSPACE/req.wfs
29+
WFLISTS_CNT=$(echo ${WORKFLOWS} | tr ',' '\n' | grep -v "^[1-9][0-9]*\(.[0-9][0-9]*\|\)\s" | wc -l)
30+
WFS_CNT=$(echo ${WORKFLOWS} | tr ',' '\n' | wc -l)
31+
OFILE="workflows.out"
32+
BADLIST_CNT=$(grep $OFILE -e "is not a possible selected entry" | wc -l)
33+
runTheMatrix.py -n ${OPTS} ${MATRIX_ARGS} ${WORKFLOWS} > $OFILE
34+
if [ $BADLIST_CNT -gt 0 ]; then
35+
if [ $WFLISTS_CNT -ne $WFS_CNT ]; then
36+
echo "WARNING : some workflow lists were not recognized"
37+
else
38+
if [ $BADLIST_CNT -eq $WFS_CNT ]; then
39+
echo "ERROR : all workflow lists were not recognized, and no additional workflows were requested"
40+
rm $OFILE
41+
exit 1
42+
else
43+
echo "WARNING : none of the workflow lists were recognized, only running explicitly requested workflows"
44+
fi
45+
fi
46+
fi
47+
48+
grep $OFILE -v ' workflows ' | grep '^[1-9][0-9]*\(.[0-9][0-9]*\|\)\s' | sed 's| .*||' > $WORKSPACE/req.wfs
49+
rm $OFILE
3050
for wf in $(cat $WORKSPACE/req.wfs) ; do
3151
[ $(echo " $REL_WFS " | grep " $wf " | wc -l) -eq 0 ] || continue
3252
WFS="${wf},${WFS}"

0 commit comments

Comments
 (0)