From 96c911f1c6b9022ec74ecdcaa16d8a2ee2836e77 Mon Sep 17 00:00:00 2001 From: zhoucheng Date: Thu, 26 Dec 2024 12:36:35 +0800 Subject: [PATCH] fix cov --- .github/actions/upload-coverage/action.yml | 6 ---- .../actions/upload-total-coverage/action.yml | 34 ++++++++----------- .github/workflows/sync.yml | 6 ---- 3 files changed, 15 insertions(+), 31 deletions(-) diff --git a/.github/actions/upload-coverage/action.yml b/.github/actions/upload-coverage/action.yml index c0ab00baec0f..09cebc64a80a 100644 --- a/.github/actions/upload-coverage/action.yml +++ b/.github/actions/upload-coverage/action.yml @@ -1,12 +1,6 @@ name: 'upload_coverage_report' description: 'upload coverage report of one job' inputs: - type: - description: 'type of the test' - required: true - default: 'integration' - type: string - UPLOAD_TOKEN: description: 'upload token' required: true diff --git a/.github/actions/upload-total-coverage/action.yml b/.github/actions/upload-total-coverage/action.yml index 072ae6ef7fbc..858f87dd4ccd 100644 --- a/.github/actions/upload-total-coverage/action.yml +++ b/.github/actions/upload-total-coverage/action.yml @@ -1,12 +1,6 @@ name: 'upload_total_coverage_report' description: 'upload total coverage report of all jobs in workflow' inputs: - type: - description: 'type of the test' - required: true - default: 'integration' - type: string - UPLOAD_TOKEN: description: 'upload token' required: true @@ -15,25 +9,27 @@ inputs: runs: using: "composite" steps: - - name: generate coverage report - working-directory: cover + - name: generate total coverage report shell: bash run: | echo "current dir is $(pwd)" - coverdirs="" - for dir in $(find . -mindepth 1 -maxdepth 1 -type d -exec basename {} \;); do - coverdirs+="$dir/," - done + if [[ "${{github.event}}" == "schedule" ]]; then + coverdirs="cover," + else + for dir in $(find cover -mindepth 1 -maxdepth 1 -type d -exec basename {} \;); do + coverdirs+="cover/$dir/," + done + fi coverdirs=${coverdirs%,} echo coverdirs is $coverdirs [[ -z "$coverdirs" ]] && echo "no coverage dir found" && exit 1 - sudo go tool covdata percent -i=$coverdirs | sudo tee cover.percent - echo "generated coverage percent report:" $(realpath cover.percent) - sudo go tool covdata textfmt -o cover.txt -i=$coverdirs - echo "generated coverage report in text format:" $(realpath cover.txt) - sudo go tool cover -html=cover.txt -o cover.html - echo "generated coverage report in html format:" $(realpath cover.html) - ls -l cover* + sudo go tool covdata percent -i=$coverdirs | sudo tee cover/cover.percent + echo "generated coverage percent report:" $(realpath cover/cover.percent) + sudo go tool covdata textfmt -o cover/cover.txt -i=$coverdirs + echo "generated coverage report in text format:" $(realpath cover/cover.txt) + sudo go tool cover -html=cover/cover.txt -o cover/cover.html + echo "generated coverage report in html format:" $(realpath cover/cover.html) + ls -l cover/cover* - name: upload coverage report shell: bash diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 6813feeebba0..8b2fdbf25cd2 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -84,12 +84,6 @@ jobs: echo "Unknown type: ${{matrix.type}}" exit 1 fi - - - name: upload coverage report - timeout-minutes: 10 - uses: ./.github/actions/upload-coverage - with: - UPLOAD_TOKEN: ${{ secrets.CI_COVERAGE_FILE_UPLOAD_AUTH_TOKEN }} - name: Setup upterm session if: failure() && (github.event.inputs.debug == 'true' || github.run_attempt != 1)