Skip to content

Commit 480d8e1

Browse files
committed
对Go客户端也提供CI/CD测试流程
1 parent d9d658f commit 480d8e1

1 file changed

Lines changed: 37 additions & 1 deletion

File tree

.github/workflows/maven.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,31 @@ jobs:
3535
**/target/surefire-reports/*.txt
3636
**/target/surefire-reports/*.xml
3737
38+
go-client-check:
39+
runs-on: ubuntu-latest
40+
timeout-minutes: 10
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Set up Go
46+
uses: actions/setup-go@v5
47+
with:
48+
go-version-file: go_client/go.mod
49+
cache-dependency-path: go_client/go.sum
50+
51+
- name: Verify Go Client Build
52+
working-directory: go_client
53+
run: |
54+
set -euo pipefail
55+
go mod download
56+
go test ./...
57+
go build -o /tmp/go-rpc-client main.go
58+
3859
integration-test:
3960
runs-on: ubuntu-latest
4061
timeout-minutes: 30
41-
needs: unit-tests
62+
needs: [unit-tests, go-client-check]
4263

4364
services:
4465
nacos:
@@ -70,6 +91,12 @@ jobs:
7091
with:
7192
python-version: '3.x'
7293

94+
- name: Set up Go
95+
uses: actions/setup-go@v5
96+
with:
97+
go-version-file: go_client/go.mod
98+
cache-dependency-path: go_client/go.sum
99+
73100
- name: Install Python Dependencies
74101
run: |
75102
set -euo pipefail
@@ -107,6 +134,14 @@ jobs:
107134
python client.py | tee ../python-client.log
108135
grep -q "Message: Success" ../python-client.log
109136
137+
- name: Run Go Client
138+
working-directory: go_client
139+
run: |
140+
set -euo pipefail
141+
echo "Running Go Client..."
142+
go run main.go | tee ../go-client.log
143+
grep -q "Message: Success" ../go-client.log
144+
110145
- name: Upload CI Logs
111146
if: always()
112147
uses: actions/upload-artifact@v4
@@ -115,3 +150,4 @@ jobs:
115150
path: |
116151
server.log
117152
python-client.log
153+
go-client.log

0 commit comments

Comments
 (0)