From b2216cd44ccb565e7fd6d72e072c08dc75917cd7 Mon Sep 17 00:00:00 2001 From: naisila Date: Fri, 10 Jan 2025 22:19:00 +0300 Subject: [PATCH] Revert "remove codeclimate" This reverts commit a7ec6f726fd6959848fdbb6b8c27b4e5a3a274d5. --- .github/actions/upload_coverage/action.yml | 12 ++++++++++++ .github/workflows/build_and_test.yml | 22 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/.github/actions/upload_coverage/action.yml b/.github/actions/upload_coverage/action.yml index 784cb2a76..0b5f581a6 100644 --- a/.github/actions/upload_coverage/action.yml +++ b/.github/actions/upload_coverage/action.yml @@ -13,3 +13,15 @@ runs: token: ${{ inputs.codecov_token }} verbose: true gcov: true + - name: Create codeclimate coverage + run: |- + lcov --directory . --capture --output-file lcov.info + lcov --remove lcov.info -o lcov.info '/usr/*' + sed "s=^SF:$PWD/=SF:=g" -i lcov.info # relative pats are required by codeclimate + mkdir -p /tmp/codeclimate + cc-test-reporter format-coverage -t lcov -o /tmp/codeclimate/${{ inputs.flags }}.json lcov.info + shell: bash + - uses: actions/upload-artifact@v3.1.1 + with: + path: "/tmp/codeclimate/*.json" + name: codeclimate diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index d7f796ce3..99e01c477 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -385,6 +385,28 @@ jobs: with: flags: ${{ env.pg_major }}_upgrade codecov_token: ${{ secrets.CODECOV_TOKEN }} + upload-coverage: + if: always() + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + runs-on: ubuntu-20.04 + container: + image: ${{ needs.params.outputs.test_image_name }}:${{ fromJson(needs.params.outputs.pg16_version).full }}${{ needs.params.outputs.image_suffix }} + needs: + - params + - test-citus + - test-arbitrary-configs + - test-citus-upgrade + - test-pg-upgrade + steps: + - uses: actions/download-artifact@v3.0.1 + with: + name: "codeclimate" + path: "codeclimate" + - name: Upload coverage results to Code Climate + run: |- + cc-test-reporter sum-coverage codeclimate/*.json -o total.json + cc-test-reporter upload-coverage -i total.json ch_benchmark: name: CH Benchmark if: startsWith(github.ref, 'refs/heads/ch_benchmark/')