Skip to content

Commit bebba2e

Browse files
ShfdisShfdis
authored andcommitted
simplify the action
1 parent 63d3696 commit bebba2e

4 files changed

Lines changed: 0 additions & 159 deletions

File tree

.github/actions/gcovr/action.yaml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ inputs:
2626
description: Fail if line coverage is below this percent (0 disables the gate)
2727
required: false
2828
default: "0"
29-
post-pr-comment:
30-
description: Post or update a sticky coverage summary on the pull request
31-
required: false
32-
default: "true"
33-
github-token:
34-
description: Token for posting PR comments
35-
required: false
36-
default: ${{ github.token }}
3729

3830
runs:
3931
using: composite
@@ -64,16 +56,3 @@ runs:
6456
GCOV_EXECUTABLE="${{ inputs.gcov-executable }}" \
6557
FAIL_UNDER_LINE="${{ inputs.fail-under-line }}" \
6658
"${{ github.action_path }}/run_gcovr.sh"
67-
68-
- name: Post coverage PR comment
69-
if: inputs.post-pr-comment == 'true'
70-
shell: bash
71-
env:
72-
GH_TOKEN: ${{ inputs.github-token }}
73-
PR_NUMBER: ${{ github.event.pull_request.number }}
74-
OUTPUT_DIR: ${{ github.workspace }}/${{ inputs.output-directory }}
75-
GITHUB_REPOSITORY: ${{ github.repository }}
76-
GITHUB_RUN_ID: ${{ github.run_id }}
77-
run: |
78-
chmod +x "${{ github.action_path }}/post_pr_comment.sh"
79-
"${{ github.action_path }}/post_pr_comment.sh"

.github/actions/gcovr/post_pr_comment.sh

Lines changed: 0 additions & 109 deletions
This file was deleted.

.github/actions/gcovr/run_gcovr.sh

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,3 @@ if [[ -n "${FAIL_UNDER_LINE:-}" && "${FAIL_UNDER_LINE}" != "0" ]]; then
3030
fi
3131

3232
gcovr "${gcovr_args[@]}"
33-
34-
if [[ -n "${GITHUB_STEP_SUMMARY:-}" && -f "${OUTPUT_DIR}/summary.json" ]]; then
35-
{
36-
echo "## Code coverage"
37-
echo ""
38-
echo "| Metric | Covered | Total | Percent |"
39-
echo "| --- | ---: | ---: | ---: |"
40-
jq -r '
41-
def metric($name):
42-
if has($name) then
43-
.[$name]
44-
else
45-
{
46-
covered: .[$name + "_covered"],
47-
num: .[$name + "_total"],
48-
percent: .[$name + "_percent"]
49-
}
50-
end;
51-
metric("line") as $l
52-
| metric("branch") as $b
53-
| metric("function") as $f
54-
| "| Line | \($l.covered) | \($l.num) | \($l.percent // 0)% |",
55-
"| Branch | \($b.covered) | \($b.num) | \($b.percent // 0)% |",
56-
"| Function | \($f.covered) | \($f.num) | \($f.percent // 0)% |"
57-
' "${OUTPUT_DIR}/summary.json"
58-
} >> "${GITHUB_STEP_SUMMARY}"
59-
fi

.github/workflows/coverage.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
permissions:
2020
contents: read
2121
id-token: write
22-
pull-requests: write
2322
services:
2423
ydb:
2524
image: ydbplatform/local-ydb:24.4
@@ -70,7 +69,6 @@ jobs:
7069
build-directory: build
7170
source-root: ${{ github.workspace }}
7271
gcov-executable: gcov-13
73-
post-pr-comment: ${{ github.event_name == 'pull_request' }}
7472

7573
- name: Upload coverage to Codecov
7674
uses: codecov/codecov-action@v5

0 commit comments

Comments
 (0)