Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: fix coverage for schedule run. #5439

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/actions/upload-coverage/action.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
34 changes: 15 additions & 19 deletions .github/actions/upload-total-coverage/action.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading