@@ -119,6 +119,20 @@ jobs:
119119 MAVEN_TOKEN : ${{ secrets.OSSRH_TOKEN }}
120120 GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
121121
122+ - name : maven coverage
123+ working-directory : java
124+ run : |
125+ ./mvnw --batch-mode prepare-package
126+ ./mvnw --batch-mode scoverage:report
127+
128+ - name : upload maven coverage
129+ uses : codecov/codecov-action@v2
130+ with :
131+ files : java/**/target/site/jacoco/jacoco.xml,java/**/target/scoverage.xml
132+ name : coverage
133+ fail_ci_if_error : true
134+ verbose : true
135+
122136 - name : stop services
123137 run : |
124138 cd onebox && sh stop_all.sh && cd - || exit
@@ -138,18 +152,18 @@ jobs:
138152 OPENMLDB_BUILD_TARGET : ' cp_native_so openmldb'
139153 NPROC : 3
140154 steps :
141- - uses : actions/checkout@v2
155+ - uses : actions/checkout@v3
142156
143157 - name : Cache local Maven repository
144- uses : actions/cache@v2
158+ uses : actions/cache@v3
145159 with :
146160 path : ~/.m2/repository
147161 key : ${{ runner.os }}-maven-${{ hashFiles('java/**/pom.xml') }}
148162 restore-keys : |
149163 ${{ runner.os }}-maven-
150164
151165 - name : Cache thirdparty
152- uses : actions/cache@v2
166+ uses : actions/cache@v3
153167 with :
154168 path : |
155169 .deps/
@@ -249,7 +263,7 @@ jobs:
249263 pip install setuptools wheel twine
250264 yum install -y net-tools
251265
252- - name : test sqlalchemy
266+ - name : test sqlalchemy and generate coverage report
253267 run : |
254268 bash steps/test_python.sh
255269
@@ -261,6 +275,14 @@ jobs:
261275 path : |
262276 python/openmldb/test/pytest.xml
263277
278+ - name : upload python coverage to codecov
279+ uses : codecov/codecov-action@v2
280+ with :
281+ name : coverage
282+ files : python/test/coverage.xml
283+ fail_ci_if_error : true
284+ verbose : true
285+
264286 - name : upload to pypi
265287 if : >
266288 github.repository == '4paradigm/OpenMLDB' && startsWith(github.ref, 'refs/tags/v')
@@ -273,14 +295,15 @@ jobs:
273295
274296 python-sdk-mac :
275297 runs-on : macos-latest
298+ if : github.event_name == 'push'
276299 env :
277300 SQL_PYSDK_ENABLE : ON
278301 OPENMLDB_BUILD_TARGET : ' cp_python_sdk_so openmldb'
279302 steps :
280- - uses : actions/checkout@v2
281-
303+ - uses : actions/checkout@v3
304+
282305 - name : Cache thirdparty
283- uses : actions/cache@v2
306+ uses : actions/cache@v3
284307 with :
285308 path : |
286309 .deps/
@@ -328,7 +351,7 @@ jobs:
328351
329352 publish-test-results :
330353 runs-on : ubuntu-latest
331- needs : [ "java-sdk", "python-sdk", "python-sdk-mac" ]
354+ needs : [ "java-sdk", "python-sdk" ]
332355
333356 # the action will only run on 4paradigm/OpenMLDB's context, not for fork repo or dependabot
334357 if : >
0 commit comments