@@ -37,13 +37,13 @@ jobs:
3737
3838 - name : Start httpbin
3939 run : |
40- # 使用 httpbin 官方镜像
40+ # Use official httpbin image
4141 docker run -d \
4242 --name httpbin \
4343 -p 8888:80 \
4444 kennethreitz/httpbin:latest
4545
46- # 等待服务就绪
46+ # Wait for service to be ready
4747 echo "Waiting for httpbin to be ready..."
4848 for i in {1..30}; do
4949 if curl -f http://localhost:8888/get > /dev/null 2>&1; then
6060
6161 - name : Start json-server
6262 run : |
63- # 使用 Node.js 官方镜像运行 json-server
63+ # Use Node.js official image to run json-server
6464 docker run -d \
6565 --name json-api \
6666 -p 8889:3000 \
6969 node:18-alpine \
7070 sh -c "npm install -g [email protected] && json-server --host 0.0.0.0 --port 3000 db.json" 7171
72- # 等待服务就绪
72+ # Wait for service to be ready
7373 echo "Waiting for json-api to be ready..."
7474 for i in {1..60}; do
7575 if curl -f http://localhost:8889/posts > /dev/null 2>&1; then
8686
8787 - name : Start WebSocket echo server
8888 run : |
89- # 使用简单的 Python WebSocket echo server
89+ # Use simple Python WebSocket echo server
9090 cat > ws-echo.py << 'EOF'
9191 import asyncio
9292 import websockets
@@ -110,11 +110,11 @@ jobs:
110110 python:3.11-alpine \
111111 sh -c "pip install websockets && python /ws-echo.py"
112112
113- # 等待服务就绪 - WebSocket 服务启动很快
113+ # Wait for service to be ready - WebSocket service starts quickly
114114 echo "Waiting for ws-echo to be ready..."
115115 sleep 10
116116
117- # 检查容器是否在运行
117+ # Check if container is running
118118 if docker ps | grep -q ws-echo; then
119119 echo "✅ ws-echo container is running!"
120120 else
@@ -151,7 +151,7 @@ jobs:
151151 curl -f http://localhost:8889/posts
152152
153153 echo "Checking ws-echo (WebSocket service - checking port)..."
154- # WebSocket 服务不能用普通 HTTP 请求检查,检查端口是否监听
154+ # WebSocket service cannot be checked with regular HTTP requests, check if port is listening
155155 if timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/8890'; then
156156 echo "✅ ws-echo port 8890 is listening"
157157 else
0 commit comments