Skip to content

Commit c588948

Browse files
committed
ci(e2e): add cold-start init smoke job in fresh ubuntu container
The regular e2e job runs on a GitHub Actions runner that already has rustup, Bun, IPFS, and friends on PATH. As a result, init's toolchain-install code path is never exercised in CI — regressions that only surface on a fresh user machine (e.g., paritytech/ playground-app#118, where newly-installed rustup wasn't reachable from the same init process) pass every PR silently. Add a sibling job that runs `dot init -y` inside ubuntu:22.04 with nothing pre-installed beyond what's strictly needed to bootstrap bun and pnpm. If init reaches "setup complete" with no failed dependency rows, every tool was both installed AND reachable to the next step in the same process — which is the exact contract #118 broke. Excluded from per-PR runs because it pulls full toolchains over the network and takes several minutes. Daily cron + manual dispatch only.
1 parent bda2cc0 commit c588948

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,70 @@ jobs:
4343
TEST_TEMPLATE_DOMAIN: rock-paper-scissors.dot
4444
TEST_TEMPLATE_REPO: https://github.com/paritytech/Rock-Paper-Scissors
4545
DOT_DEPLOY_VERBOSE: "1"
46+
47+
init-cold-smoke:
48+
# Runs `dot init` inside a fresh ubuntu:22.04 container — no rustup,
49+
# no IPFS, no foundry, no cdm pre-installed. The regular `e2e` job
50+
# above runs on a GitHub Actions runner that already has most of
51+
# those tools on PATH, so it can't catch regressions in the install
52+
# / post-install path-config logic (e.g. paritytech/playground-app#118).
53+
# This job is the cold-start defence: every dependency must be
54+
# installed AND become reachable to subsequent init steps.
55+
#
56+
# Excluded from per-PR runs because it pulls full toolchains (rustup,
57+
# nightly, cdm, foundry, kubo) from the network and takes ~10 min.
58+
# Daily cron + manual dispatch only.
59+
name: Init cold-start smoke test
60+
runs-on: ubuntu-latest
61+
timeout-minutes: 30
62+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
63+
steps:
64+
- uses: actions/checkout@v4
65+
66+
- name: Run dot init in fresh ubuntu container
67+
run: |
68+
docker run --rm \
69+
-v "${{ github.workspace }}:/work" \
70+
-w /work \
71+
-e CI=true \
72+
ubuntu:22.04 \
73+
bash -eux -c '
74+
# Minimal prerequisites — anything beyond these is what
75+
# `dot init` is expected to install for itself.
76+
apt-get update -qq
77+
DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends \
78+
curl ca-certificates bash unzip git build-essential sudo
79+
80+
# bun (CLI runtime)
81+
export BUN_INSTALL=/usr/local/bun
82+
curl -fsSL https://bun.sh/install | bash
83+
export PATH="$BUN_INSTALL/bin:$PATH"
84+
85+
# pnpm (package manager) — install via standalone script
86+
# so we do not depend on a pre-existing Node.
87+
curl -fsSL https://get.pnpm.io/install.sh | env SHELL=$(which bash) bash -
88+
export PNPM_HOME=/root/.local/share/pnpm
89+
export PATH="$PNPM_HOME:$PATH"
90+
91+
pnpm install --frozen-lockfile
92+
93+
# ── The actual smoke test ──────────────────────────────
94+
# `dot init -y` runs the dependency installer end-to-end.
95+
# If init reports "setup complete" with no failed rows,
96+
# every tool was installed AND was reachable to the
97+
# next step in the same process — which is the exact
98+
# path config that #118 broke.
99+
bun run src/index.ts init -y 2>&1 | tee /tmp/init.log
100+
101+
grep -q "setup complete" /tmp/init.log || {
102+
echo "::error::dot init did not reach '\''setup complete'\''"
103+
exit 1
104+
}
105+
106+
# Reject any failed-row markers. Ink renders them with
107+
# ✗ (U+2717) — match common shapes plus the literal word.
108+
if grep -E "✗|✕| failed| error" /tmp/init.log; then
109+
echo "::error::dot init reported a failed dependency"
110+
exit 1
111+
fi
112+
'

0 commit comments

Comments
 (0)