diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 6d85fb54792..2e44ddc5328 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -43,12 +43,12 @@ jobs: BUILD_SHARED_LIBS: ON TESTING_ENABLE_STRIP: ON steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: download lcov - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: linux-test-project/lcov ref: v1.16 @@ -73,10 +73,34 @@ jobs: - name: debug if: always() - run: | + run: | du -d 1 -h build df -h + - name: upload coverage + uses: actions/upload-artifact@v3 + with: + # include the generated html report in build/coverage, great for local diagnose + name: coverage-cpp-${{ github.sha }} + path: | + build/coverage.* + build/coverage/ + retention-days: 3 + + coverage-publish: + needs: ["coverage"] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Download Artifacts + uses: actions/download-artifact@v3 + with: + name: coverage-cpp-${{ github.sha }} + path: build + - name: Upload Coverage Report uses: codecov/codecov-action@v3 with: @@ -84,7 +108,3 @@ jobs: name: coverage-cpp fail_ci_if_error: true verbose: true - - - name: stop service - run: | - ./steps/ut_zookeeper.sh stop diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index b40fa87f331..b06c39d48ab 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -133,13 +133,14 @@ jobs: ./mvnw --batch-mode prepare-package ./mvnw --batch-mode scoverage:report - - name: upload maven coverage - uses: codecov/codecov-action@v3 + - name: upload coverage + uses: actions/upload-artifact@v3 with: - files: java/**/target/site/jacoco/jacoco.xml,java/**/target/scoverage.xml - name: coverage-java - fail_ci_if_error: true - verbose: true + name: coverage-java-report-${{ github.sha }} + path: | + java/**/target/site/jacoco/jacoco.xml + java/**/target/scoverage.xml + retention-days: 3 - name: stop services run: | @@ -283,13 +284,14 @@ jobs: python/openmldb_sdk/tests/pytest.xml python/openmldb_tool/tests/pytest.xml - - name: upload python coverage to codecov - uses: codecov/codecov-action@v3 + - name: upload coverage + uses: actions/upload-artifact@v3 with: - name: coverage-python - files: python/openmldb_sdk/tests/coverage.xml,python/openmldb_tool/tests/coverage.xml - fail_ci_if_error: true - verbose: true + name: coverage-python-report-${{ github.sha }} + path: | + python/openmldb_sdk/tests/coverage.xml + python/openmldb_tool/tests/coverage.xml + retention-days: 3 - name: upload to pypi if: > @@ -388,16 +390,12 @@ jobs: working-directory: go run: go test ./... -race -covermode=atomic -coverprofile=coverage.out - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + - name: upload coverage + uses: actions/upload-artifact@v3 with: - name: coverage-go - files: go/coverage.out - fail_ci_if_error: true - verbose: true - - - name: stop server - run: ./openmldb/sbin/stop-all.sh + name: coverage-go-report-${{ github.sha }} + path: go/coverage.out + retention-days: 3 publish-test-results: needs: ["java-sdk", "python-sdk", "go-sdk"] @@ -414,3 +412,37 @@ jobs: mac-ut-result-*/**/*.xml check_name: SDK Test Report comment_title: SDK Test Report + + publish-coverage-results: + needs: ["java-sdk", "python-sdk", "go-sdk"] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Download Artifacts (java) + uses: actions/download-artifact@v3 + with: + name: coverage-java-report-${{ github.sha }} + path: java + + - name: Download Artifacts (python) + uses: actions/download-artifact@v3 + with: + name: coverage-python-report-${{ github.sha }} + path: python + + - name: Download Artifacts (go) + uses: actions/download-artifact@v3 + with: + name: coverage-go-report-${{ github.sha }} + path: go + + - name: Upload Coverage Report + uses: codecov/codecov-action@v3 + with: + files: go/coverage.out,python/openmldb_sdk/tests/coverage.xml,python/openmldb_tool/tests/coverage.xml,java/**/target/site/jacoco/jacoco.xml,java/**/target/scoverage.xml + name: coverage-sdk + fail_ci_if_error: true + verbose: true