diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b500e912b..e8eaa4cd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -388,11 +388,11 @@ jobs: - name: Run storyboard suite timeout-minutes: 5 - # @adcp/client@latest is intentionally unpinned — this is AdCP's own CI + # @adcp/sdk@latest is intentionally unpinned — this is AdCP's own CI # running AdCP's own canonical runner. Tracking latest surfaces protocol # drift as soon as it ships, which is the point of this job. run: | - npx -y -p @adcp/client@latest adcp storyboard run \ + npx -y -p @adcp/sdk@latest adcp storyboard run \ http://127.0.0.1:3001/mcp media_buy_seller \ --json --allow-http \ > storyboard-result.json @@ -484,31 +484,52 @@ jobs: uses: actions/setup-node@v4 with: node-version: "22" + # No cache: requires a package-lock.json which this Python + # repo doesn't ship. The pre-install step below uses + # ``npm install -g`` which is fast on the runner anyway + # (~3-5s with warm tarball mirrors). - name: Install dependencies run: | python -m pip install --upgrade pip pip install -e ".[dev,pg]" + - name: Pre-install @adcp/client (separate from boot) + # Pull the package + its deps into the npm cache up-front so the + # boot step doesn't have to do an install in its 60s readiness + # window. ``npx --yes`` fetches into the cache; the + # ``--package=...`` form leaves an installed copy that subsequent + # ``npx`` invocations resolve instantly. ``adcp --version`` is a + # cheap smoke that the binary is wired correctly. + run: | + npm install -g @adcp/sdk@latest + adcp --version + - name: Start JS mock-server upstream run: | - npx -y -p @adcp/client@latest \ - adcp mock-server sales-guaranteed --port 4503 --api-key test-key & + # Cached install above means this is a hot-start (~2-3s on + # GHA-hosted runners) — no npm install delay. Tee output to + # /tmp/mock-server.log so failures surface their stack traces + # (otherwise the readiness loop just times out silently). + adcp mock-server sales-guaranteed --port 4503 --api-key test-key \ + > /tmp/mock-server.log 2>&1 & MOCK_PID=$! echo "MOCK_PID=$MOCK_PID" >> "$GITHUB_ENV" # Health-check via /_debug/traffic — non-network-scoped and # no-auth, so it doesn't break when the JS mock's seed-data # renames or removes a specific network. The endpoint is # always present on the harness-side mock. - for i in $(seq 1 60); do + for i in $(seq 1 120); do HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" --max-time 1 \ http://127.0.0.1:4503/_debug/traffic 2>/dev/null || echo "000") if [ "$HTTP_CODE" = "200" ]; then - echo "Upstream mock ready (HTTP 200, pid $MOCK_PID)" + echo "Upstream mock ready (HTTP 200, pid $MOCK_PID, $i polls)" break fi - if [ "$i" -eq 60 ]; then - echo "Upstream mock failed to start within 30s" + if [ "$i" -eq 120 ]; then + echo "Upstream mock failed to start within 60s" + echo "--- mock-server.log ---" + cat /tmp/mock-server.log || echo "(log unavailable)" kill "$MOCK_PID" 2>/dev/null || true exit 1 fi @@ -571,7 +592,7 @@ jobs: # /etc/hosts override so the buyer can reach acme.localhost # (the seeded tenant subdomain). echo "127.0.0.1 acme.localhost" | sudo tee -a /etc/hosts - npx -y -p @adcp/client@latest adcp storyboard run \ + npx -y -p @adcp/sdk@latest adcp storyboard run \ http://acme.localhost:3001/mcp media_buy_seller \ --json --allow-http \ > v3-storyboard-result.json || true