Skip to content

Commit 4d7d026

Browse files
committed
ci: bootstrap from the index when validating an unreleased mcpp
The pin may name the very release the run is validating, which does not exist yet — that is what MCPP_SOURCE_REF is for. Bootstrap from whatever the index has; the build under review replaces it a step later.
1 parent 80ab242 commit 4d7d026

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,15 @@ jobs:
6262
# of the two situations it is.
6363
for attempt in 1 2 3 4 5 6; do
6464
xlings update > /dev/null 2>&1 || true
65-
if xlings install "mcpp@$MCPP_VERSION" -y -g; then break; fi
65+
if # ⚠️ THE PIN MAY NAME THE RELEASE THIS RUN IS VALIDATING, which does
66+
# not exist yet — that is the whole point of MCPP_SOURCE_REF. Bootstrap
67+
# from whatever the index has; the step below replaces it with the
68+
# build under review, and the pin is what an ordinary run tests.
69+
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
70+
xlings install mcpp -y -g
71+
else
72+
xlings install "mcpp@$MCPP_VERSION" -y -g
73+
fi; then break; fi
6674
if [ "$attempt" = 6 ]; then
6775
echo "::error::mcpp@$MCPP_VERSION never appeared in the index (6 attempts over 5 minutes). If it was just released, the pointer has not propagated; if the pin names a version that was never published, it never will."
6876
exit 1
@@ -260,7 +268,15 @@ jobs:
260268
# of the two situations it is.
261269
for attempt in 1 2 3 4 5 6; do
262270
xlings update > /dev/null 2>&1 || true
263-
if xlings install "mcpp@$MCPP_VERSION" -y -g; then break; fi
271+
if # ⚠️ THE PIN MAY NAME THE RELEASE THIS RUN IS VALIDATING, which does
272+
# not exist yet — that is the whole point of MCPP_SOURCE_REF. Bootstrap
273+
# from whatever the index has; the step below replaces it with the
274+
# build under review, and the pin is what an ordinary run tests.
275+
if [ -n "${MCPP_SOURCE_REF:-}" ]; then
276+
xlings install mcpp -y -g
277+
else
278+
xlings install "mcpp@$MCPP_VERSION" -y -g
279+
fi; then break; fi
264280
if [ "$attempt" = 6 ]; then
265281
echo "::error::mcpp@$MCPP_VERSION never appeared in the index (6 attempts over 5 minutes). If it was just released, the pointer has not propagated; if the pin names a version that was never published, it never will."
266282
exit 1

0 commit comments

Comments
 (0)