File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,13 +93,37 @@ jobs:
9393 shell : bash
9494 run : |
9595 set -euo pipefail
96- port=18080
96+ port=$((RANDOM % 1000 + 18080))
9797 serve_root="$RUNNER_TEMP/serve"
9898
99- python3 -m http.server "$port" --directory "$serve_root" >"$RUNNER_TEMP/http.log" 2>&1 &
99+ if command -v python3 >/dev/null 2>&1; then
100+ python_cmd="python3"
101+ elif command -v python >/dev/null 2>&1; then
102+ python_cmd="python"
103+ else
104+ echo "Python is required for installer smoke tests." >&2
105+ exit 1
106+ fi
107+
108+ "$python_cmd" -m http.server "$port" --directory "$serve_root" >"$RUNNER_TEMP/http.log" 2>&1 &
100109 server_pid=$!
101110 trap 'kill "$server_pid"' EXIT INT TERM
102- sleep 2
111+
112+ ready=0
113+ for _ in $(seq 1 30); do
114+ if curl -fsS "http://127.0.0.1:${port}/tool/install.sh" >/dev/null 2>&1; then
115+ ready=1
116+ break
117+ fi
118+ sleep 1
119+ done
120+ if [ "$ready" -ne 1 ]; then
121+ echo "Local HTTP server did not become ready on port ${port}." >&2
122+ if [ -f "$RUNNER_TEMP/http.log" ]; then
123+ cat "$RUNNER_TEMP/http.log"
124+ fi
125+ exit 1
126+ fi
103127
104128 curl -fsSL "http://127.0.0.1:${port}/tool/install.sh" | \
105129 DRX_REPO=example/drx \
You can’t perform that action at this time.
0 commit comments