Skip to content

Commit

Permalink
Prioritize step 1
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Jul 15, 2020
1 parent 475ca62 commit 530face
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .circleci/soltest_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,25 @@ REPODIR="$(realpath $(dirname $0)/..)"
# This number has to equal the number of steps below.
STEPS=11

RUN_STEPS=$(seq "$STEPS" | circleci tests split)
if [ "$CIRCLE_NODE_TOTAL" -a "$CIRCLE_NODE_TOTAL" -gt 1 ]
then
# Run step 1 as the only step on the first executor
# and evenly distribute the other steps among
# the other executors.
# The first step takes much longer than the other steps.
if [ "$CIRCLE_NODE_INDEX" = "0" ]
then
RUN_STEPS="1"
else
export CIRCLE_NODE_INDEX=$(($CIRCLE_NODE_INDEX - 1))
export CIRCLE_NODE_TOTAL=$(($CIRCLE_NODE_TOTAL - 1))
RUN_STEPS=$(seq 2 "$STEPS" | circleci tests split)
fi
else
RUN_STEPS=$(seq "$STEPS")
fi

# turn newlines into spaces
RUN_STEPS=$(echo $RUN_STEPS)

echo "Running steps $RUN_STEPS..."
Expand Down

0 comments on commit 530face

Please sign in to comment.