You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: optimize CI test job with single container mode
- Replace 22+ docker run calls with single background container
- Add timeout protection at job (15min) and step (1-5min) levels
- Add 10s timeout per tool test command
- Add cleanup step with 'if: always()' to ensure container removal
- Expected: test time reduced from 5+ minutes to 30-60 seconds
if docker run --rm ${{ env.IMAGE_NAME }}:${{ env.DATE_TAG }} bash -c "sudo su - root" 2>&1 | grep -q "sudo: su: command not found\|Sorry, user coder is not allowed to execute"; then
272
+
if docker exec test-container bash -c "sudo su - root" 2>&1 | grep -q "sudo: su: command not found\|Sorry, user coder is not allowed to execute"; then
253
273
echo "✓ su command is properly blocked"
254
274
else
255
275
echo "::warning::su command might not be properly blocked"
256
276
fi
257
277
258
278
- name: Test mirror configurations
279
+
timeout-minutes: 2
259
280
run: |
260
281
echo "Testing mirror configurations..."
261
282
262
283
# Test Go proxy
263
-
docker run --rm ${{ env.IMAGE_NAME }}:${{ env.DATE_TAG }} bash -c 'echo $GOPROXY | grep -q "goproxy.cn"' && echo " ✓ Go proxy configured" || echo " ⚠ Go proxy not using goproxy.cn"
284
+
docker exec test-container bash -c 'echo $GOPROXY | grep -q "goproxy.cn"' && echo " ✓ Go proxy configured" || echo " ⚠ Go proxy not using goproxy.cn"
264
285
265
286
# Test npm registry
266
-
docker run --rm ${{ env.IMAGE_NAME }}:${{ env.DATE_TAG }} bash -c 'npm config get registry | grep -q "npmmirror"' && echo " ✓ npm registry configured" || echo " ⚠ npm registry not using npmmirror"
287
+
docker exec test-container bash -c 'npm config get registry | grep -q "npmmirror"' && echo " ✓ npm registry configured" || echo " ⚠ npm registry not using npmmirror"
0 commit comments