@@ -127,21 +127,65 @@ jobs:
127127 # Optional: Print initial logs
128128 head -n 20 server.log
129129
130- - name : Run Python Client
130+ - name : Run Java Client Chain
131+ continue-on-error : true
132+ run : |
133+ set -euo pipefail
134+ mkdir -p .ci-status
135+ CLASSPATH="rpc-consumer/target/rpc-consumer-1.0-SNAPSHOT.jar:rpc-transport-netty/target/rpc-transport-netty-1.0-SNAPSHOT.jar:rpc-core/target/rpc-core-1.0-SNAPSHOT.jar:rpc-common/target/rpc-common-1.0-SNAPSHOT.jar:rpc-api/target/rpc-api-1.0-SNAPSHOT.jar:$(mvn -q dependency:build-classpath -Dmdep.outputFile=/dev/stdout -pl rpc-consumer -am)"
136+
137+ echo "Running Java Client (grpc)..."
138+ if java -Drpc.protocol=grpc -Drpc.serializer=protobuf -cp "$CLASSPATH" com.xiaoyu.rpc.consumer.ConsumerApp | tee java-client.log \
139+ && grep -q "Result1:" java-client.log \
140+ && grep -q "Result2:" java-client.log; then
141+ echo "PASS" > .ci-status/java.status
142+ else
143+ echo "FAIL" > .ci-status/java.status
144+ fi
145+
146+ - name : Run Python Client Chain
131147 working-directory : python_client
148+ continue-on-error : true
132149 run : |
133150 set -euo pipefail
151+ mkdir -p ../.ci-status
134152 echo "Running Python Client..."
135- python client.py | tee ../python-client.log
136- grep -q "Message: Success" ../python-client.log
153+ if python client.py | tee ../python-client.log && grep -q "Message: Success" ../python-client.log; then
154+ echo "PASS" > ../.ci-status/python.status
155+ else
156+ echo "FAIL" > ../.ci-status/python.status
157+ fi
137158
138- - name : Run Go Client
159+ - name : Run Go Client Chain
139160 working-directory : go_client
161+ continue-on-error : true
140162 run : |
141163 set -euo pipefail
164+ mkdir -p ../.ci-status
142165 echo "Running Go Client..."
143- go run main.go | tee ../go-client.log
144- grep -q "Message: Success" ../go-client.log
166+ if go run main.go | tee ../go-client.log && grep -q "Message: Success" ../go-client.log; then
167+ echo "PASS" > ../.ci-status/go.status
168+ else
169+ echo "FAIL" > ../.ci-status/go.status
170+ fi
171+
172+ - name : Aggregate Multi-Client Results
173+ run : |
174+ set -euo pipefail
175+ JAVA_RESULT=$(cat .ci-status/java.status 2>/dev/null || echo "FAIL")
176+ PY_RESULT=$(cat .ci-status/python.status 2>/dev/null || echo "FAIL")
177+ GO_RESULT=$(cat .ci-status/go.status 2>/dev/null || echo "FAIL")
178+
179+ echo "Multi-client chain summary:"
180+ echo " Java : ${JAVA_RESULT}"
181+ echo " Python : ${PY_RESULT}"
182+ echo " Go : ${GO_RESULT}"
183+
184+ if [[ "${JAVA_RESULT}" != "PASS" || "${PY_RESULT}" != "PASS" || "${GO_RESULT}" != "PASS" ]]; then
185+ echo "At least one client chain failed."
186+ exit 1
187+ fi
188+ echo "All three client chains passed."
145189
146190 - name : Upload CI Logs
147191 if : always()
@@ -150,5 +194,7 @@ jobs:
150194 name : ci-logs
151195 path : |
152196 server.log
197+ java-client.log
153198 python-client.log
154199 go-client.log
200+ .ci-status/*.status
0 commit comments