Skip to content

Commit 5cfcc45

Browse files
committed
Avoid double-testing the same rev during merge queues
1 parent b533cda commit 5cfcc45

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

ci-build.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@ SRC_DIR=$(pwd)
6767
mkdir -p "build-${CC}-${PROTOCOL}"
6868
cd "build-${CC}-${PROTOCOL}"
6969

70+
# Check to see if we _just_ tested this rev in
71+
# a merge queue, and if so don't bother doing
72+
# it again. Wastes billable CPU time.
73+
if [ -e prev-pass-rev ]
74+
PREV_REV=$(cat prev-pass-rev)
75+
CURR_REV=$(git rev-parse HEAD)
76+
if [ "${PREV_REV}" = "${CURR_REV}" ]
77+
then
78+
exit 0
79+
fi
80+
rm prev-pass-rev
81+
fi
82+
83+
7084
# restore source file mtimes based on content hashes
7185
for DIR in src lib
7286
do
@@ -206,4 +220,6 @@ time make check
206220

207221
echo All done
208222
date
223+
224+
git rev-parse HEAD >prev-pass-rev
209225
exit 0

0 commit comments

Comments
 (0)