-
Notifications
You must be signed in to change notification settings - Fork 0
205 lines (175 loc) · 5.3 KB
/
Copy pathintegration.yml
File metadata and controls
205 lines (175 loc) · 5.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Extended Integration
on:
workflow_dispatch:
schedule:
- cron: '0 18 * * 0'
permissions:
contents: read
concurrency:
group: extended-integration-${{ github.ref }}
cancel-in-progress: false
jobs:
protocol-matrix:
name: Protocol - ${{ matrix.protocol }}
runs-on: ubuntu-24.04
timeout-minutes: 12
strategy:
fail-fast: false
matrix:
protocol: [ netty, http, http2, grpc ]
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up JDK 17
uses: actions/setup-java@v6
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Run end-to-end protocol test
run: >-
mvn -B -ntp test
-pl rpc-consumer -am
-Dtest=FullIntegrationTest
-Dsurefire.failIfNoSpecifiedTests=false
-Drpc.registry=local
-Drpc.protocol=${{ matrix.protocol }}
- name: Upload protocol test reports
if: always()
uses: actions/upload-artifact@v7
with:
name: protocol-${{ matrix.protocol }}-reports
retention-days: 7
if-no-files-found: warn
path: '**/target/surefire-reports/'
nacos-integration:
name: Nacos Integration
runs-on: ubuntu-24.04
timeout-minutes: 15
services:
nacos:
image: nacos/nacos-server:v2.5.4
env:
MODE: standalone
NACOS_AUTH_ENABLE: 'false'
JVM_XMS: 256m
JVM_XMX: 256m
JVM_XMN: 128m
ports:
- 8848:8848
- 9848:9848
- 9849:9849
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up JDK 17
uses: actions/setup-java@v6
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Wait for Nacos
shell: bash
run: |
for i in {1..60}; do
if curl -fsS http://127.0.0.1:8848/nacos/v1/console/health/readiness >/dev/null 2>&1; then
exit 0
fi
sleep 2
done
echo 'Nacos did not become ready in time'
docker ps -a
container_id=$(docker ps -aq --filter ancestor=nacos/nacos-server:v2.5.4 | head -1)
if [ -n "$container_id" ]; then
docker logs "$container_id" || true
fi
exit 1
- name: Run real Nacos registry integration test
run: >-
mvn -B -ntp test
-pl rpc-consumer -am
-Dtest=FullIntegrationTest
-Dsurefire.failIfNoSpecifiedTests=false
-Drpc.registry=nacos
-Drpc.registry-address=127.0.0.1:8848
-Drpc.protocol=netty
- name: Upload Nacos integration reports
if: always()
uses: actions/upload-artifact@v7
with:
name: nacos-integration-reports
retention-days: 7
if-no-files-found: warn
path: '**/target/surefire-reports/'
cross-language-grpc:
name: gRPC - Python & Go
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up JDK 17
uses: actions/setup-java@v6
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go_client/go.mod
cache-dependency-path: go_client/go.sum
- name: Install Java modules
run: mvn -B -ntp install -DskipTests -Drpc.registry=local
- name: Install Python gRPC runtime
run: python -m pip install grpcio==1.76.0 protobuf==6.31.1
- name: Start Java gRPC provider
shell: bash
run: |
nohup mvn -B -ntp -pl rpc-provider \
org.codehaus.mojo:exec-maven-plugin:3.5.0:java \
-Dexec.mainClass=com.xiaoyu.rpc.provider.ProviderApp \
-Drpc.registry=local \
-Drpc.protocol=grpc \
-Drpc.serializer=protobuf \
> provider.log 2>&1 &
echo $! > provider.pid
- name: Wait for Java provider
run: |
python - <<'PY'
import socket
import sys
import time
for _ in range(60):
try:
with socket.create_connection(('127.0.0.1', 8080), timeout=1):
sys.exit(0)
except OSError:
time.sleep(0.5)
print('Java gRPC provider did not become ready in time', file=sys.stderr)
sys.exit(1)
PY
- name: Run official Python gRPC client
run: python python_client/client.py
- name: Run Go gRPC client
working-directory: go_client
run: go run .
- name: Stop Java provider
if: always()
shell: bash
run: |
if [ -f provider.pid ]; then
kill "$(cat provider.pid)" 2>/dev/null || true
fi
- name: Upload provider log
if: always()
uses: actions/upload-artifact@v7
with:
name: cross-language-provider-log
retention-days: 7
if-no-files-found: warn
path: provider.log