@@ -20,43 +20,36 @@ jobs:
2020 name : Build
2121 runs-on : ubuntu-24.04
2222 timeout-minutes : 10
23-
2423 steps :
2524 - name : Checkout code
2625 uses : actions/checkout@v7
27-
2826 - name : Set up JDK 17
2927 uses : actions/setup-java@v6
3028 with :
3129 java-version : ' 17'
3230 distribution : ' temurin'
3331 cache : ' maven'
34-
3532 - name : Build all modules
3633 run : mvn -B -ntp clean package -DskipTests -Drpc.registry=local
3734
3835 unit-tests :
3936 name : Unit Tests & Coverage
4037 runs-on : ubuntu-24.04
4138 timeout-minutes : 10
42-
4339 steps :
4440 - name : Checkout code
4541 uses : actions/checkout@v7
46-
4742 - name : Set up JDK 17
4843 uses : actions/setup-java@v6
4944 with :
5045 java-version : ' 17'
5146 distribution : ' temurin'
5247 cache : ' maven'
53-
5448 - name : Run core, transport and starter unit tests
5549 run : >-
5650 mvn -B -ntp test
5751 -pl rpc-core,rpc-transport-netty,rpc-spring-boot-starter -am
5852 -Drpc.registry=local
59-
6053 - name : Upload unit test and coverage reports
6154 if : always()
6255 uses : actions/upload-artifact@v7
@@ -72,20 +65,15 @@ jobs:
7265 name : RPC Integration
7366 runs-on : ubuntu-24.04
7467 timeout-minutes : 10
75- outputs :
76- performance_markdown : ${{ steps.performance-record.outputs.markdown }}
77-
7868 steps :
7969 - name : Checkout code
8070 uses : actions/checkout@v7
81-
8271 - name : Set up JDK 17
8372 uses : actions/setup-java@v6
8473 with :
8574 java-version : ' 17'
8675 distribution : ' temurin'
8776 cache : ' maven'
88-
8977 - name : Run local-registry Netty end-to-end test
9078 run : >-
9179 mvn -B -ntp test
9482 -Dsurefire.failIfNoSpecifiedTests=false
9583 -Drpc.registry=local
9684 -Drpc.protocol=netty
97-
98- # Performance data is observational only. Hosted Runner variance makes absolute
99- # latency/QPS unsuitable as a merge threshold. PR CI validates the snapshot;
100- # successful main CI runs persist the result into docs/PERFORMANCE.md.
101- - name : Run RPC performance snapshot
102- run : >-
103- mvn -B -ntp test
104- -pl rpc-consumer -am
105- -Dtest=RpcPerformanceSnapshotTest
106- -Dsurefire.failIfNoSpecifiedTests=false
107- -Drpc.registry=local
108- -Drpc.protocol=netty
109- -Drpc.serializer=kryo
110- -Drpc.perf.warmup=100
111- -Drpc.perf.sequential-requests=200
112- -Drpc.perf.concurrent-requests=1000
113- -Drpc.perf.concurrency=16
114-
115- - name : Prepare performance record
116- id : performance-record
117- shell : bash
118- run : |
119- summary='rpc-consumer/target/rpc-performance/summary.md'
120- test -f "$summary"
121- {
122- echo 'markdown<<RPC_PERFORMANCE_EOF'
123- sed \
124- -e '1{/^# RPC CI Performance Snapshot$/d;}' \
125- -e '/^> Observational snapshot only\./d' \
126- -e '/^Raw per-request samples are available/d' \
127- -e 's/^## Framework metrics$/### Framework metrics/' \
128- "$summary"
129- echo 'RPC_PERFORMANCE_EOF'
130- } >> "$GITHUB_OUTPUT"
131-
13285 - name : Upload integration test reports
13386 if : always()
13487 uses : actions/upload-artifact@v7
@@ -138,66 +91,100 @@ jobs:
13891 if-no-files-found : warn
13992 path : ' **/target/surefire-reports/'
14093
94+ performance-matrix :
95+ name : RPC Performance Matrix
96+ runs-on : ubuntu-24.04
97+ timeout-minutes : 25
98+ outputs :
99+ performance_markdown : ${{ steps.performance-record.outputs.markdown }}
100+ steps :
101+ - name : Checkout code
102+ uses : actions/checkout@v7
103+ - name : Set up JDK 17
104+ uses : actions/setup-java@v6
105+ with :
106+ java-version : ' 17'
107+ distribution : ' temurin'
108+ cache : ' maven'
109+ - name : Verify tc and Docker
110+ shell : bash
111+ run : |
112+ command -v tc
113+ sudo tc qdisc show dev lo
114+ docker --version
115+ - name : Run protocol, serializer, registry and network matrix
116+ shell : bash
117+ run : bash .github/scripts/run-performance-matrix.sh
118+ - name : Prepare performance record
119+ id : performance-record
120+ shell : bash
121+ run : |
122+ matrix='rpc-consumer/target/performance-matrix/matrix.md'
123+ test -s "$matrix"
124+ delimiter="RPC_PERFORMANCE_${GITHUB_RUN_ID}_${GITHUB_RUN_ATTEMPT}"
125+ {
126+ echo "markdown<<${delimiter}"
127+ cat "$matrix"
128+ echo "${delimiter}"
129+ } >> "$GITHUB_OUTPUT"
130+
131+ ci-gate :
132+ name : CI Gate
133+ if : always()
134+ needs : [ build, unit-tests, rpc-integration, performance-matrix ]
135+ runs-on : ubuntu-24.04
136+ timeout-minutes : 2
137+ steps :
138+ - name : Verify required checks
139+ shell : bash
140+ run : |
141+ test "${{ needs.build.result }}" = "success"
142+ test "${{ needs.unit-tests.result }}" = "success"
143+ test "${{ needs.rpc-integration.result }}" = "success"
144+ test "${{ needs.performance-matrix.result }}" = "success"
145+
141146 record-performance :
142147 name : Record Performance
143148 if : >-
144149 github.event_name == 'push' &&
145150 github.ref == 'refs/heads/main' &&
146- needs.rpc-integration.result == 'success'
147- needs : [ rpc-integration ]
151+ needs.ci-gate.result == 'success' &&
152+ needs.performance-matrix.result == 'success'
153+ needs : [ ci-gate, performance-matrix ]
148154 runs-on : ubuntu-24.04
149155 timeout-minutes : 5
150156 permissions :
151157 contents : write
152-
153158 steps :
154159 - name : Checkout main
155160 uses : actions/checkout@v7
156161 with :
157162 ref : main
158163 fetch-depth : 0
159-
160- - name : Append performance snapshot
164+ - name : Append performance matrix
161165 shell : bash
162166 env :
163- PERFORMANCE_MARKDOWN : ${{ needs.rpc-integration .outputs.performance_markdown }}
167+ PERFORMANCE_MARKDOWN : ${{ needs.performance-matrix .outputs.performance_markdown }}
164168 run : |
165169 test -n "$PERFORMANCE_MARKDOWN"
170+ git pull --ff-only origin main
166171 mkdir -p docs
167172 test -f docs/PERFORMANCE.md
168-
169- short_sha="${GITHUB_SHA:0:7}"
170- recorded_at="$(date -u '+%Y-%m-%d %H:%M:%S UTC')"
171-
172173 {
173174 echo
174175 echo '---'
175176 echo
176- echo "## CI Snapshot — ${recorded_at} — \`${short_sha}\`"
177- echo
178177 printf '%s\n' "$PERFORMANCE_MARKDOWN"
179178 } >> docs/PERFORMANCE.md
180-
181179 - name : Commit performance history
182180 shell : bash
183181 run : |
184182 git config user.name 'github-actions[bot]'
185183 git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
186184 git add docs/PERFORMANCE.md
187- git commit -m 'docs: record RPC performance snapshot [skip ci]'
185+ if git diff --cached --quiet; then
186+ echo "No performance history change."
187+ exit 0
188+ fi
189+ git commit -m 'docs: record RPC performance matrix [skip ci]'
188190 git push origin HEAD:main
189-
190- ci-gate :
191- name : CI Gate
192- if : always()
193- needs : [ build, unit-tests, rpc-integration ]
194- runs-on : ubuntu-24.04
195- timeout-minutes : 2
196-
197- steps :
198- - name : Verify required checks
199- shell : bash
200- run : |
201- test "${{ needs.build.result }}" = "success"
202- test "${{ needs.unit-tests.result }}" = "success"
203- test "${{ needs.rpc-integration.result }}" = "success"
0 commit comments