Skip to content

Commit ea1ec76

Browse files
committed
chore(ci) add valgrind coverage results to coveralls
1 parent 78750ce commit ea1ec76

File tree

2 files changed

+44
-7
lines changed

2 files changed

+44
-7
lines changed

.github/workflows/job-unit-tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ jobs:
7474
name: 'Unit tests'
7575
runs-on: ${{ inputs.os }}
7676
timeout-minutes: 90
77-
outputs:
78-
coveralls_name: ${{ steps.lcov.outputs.name }}
7977
steps:
8078
- name: 'Setup deps - apt-get'
8179
if: ${{ contains(inputs.os, 'ubuntu') }}
@@ -196,7 +194,7 @@ jobs:
196194
with:
197195
token: ${{ secrets.CODECOV_TOKEN }}
198196
files: './lcov.info'
199-
flags: unit
197+
flags: ${{ steps.lcov.outputs.name }}
200198
- run: rm -f t/servroot/html/nginx.sock
201199
if: ${{ failure() && !env.ACT }}
202200
- name: Artifacts Upload

.github/workflows/job-valgrind-tests.yml

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,57 @@ jobs:
132132
exit 1
133133
fi
134134
- name: Run lcov
135+
id: lcov
135136
if: ${{ !env.ACT && inputs.coverage }}
136137
run: |
137-
lcov --gcov-tool gcov-${CC#*-} --capture --directory work/buildroot --output-file lcov.info
138-
lcov --gcov-tool gcov-${CC#*-} --remove lcov.info "*/ngx_wasm_module/src/common/debug/*" --output-file lcov.info
139-
lcov --gcov-tool gcov-${CC#*-} --extract lcov.info "*/ngx_wasm_module/src/*" --output-file lcov.info
138+
case "$CC" in
139+
clang*)
140+
lcov --gcov-tool gcov --ignore-errors source --capture --directory work/buildroot --output-file lcov.info
141+
lcov --ignore-errors unused --gcov-tool gcov --remove lcov.info "*/ngx_wasm_module/src/common/debug/*" --output-file lcov.info
142+
lcov --gcov-tool gcov --extract lcov.info "*/ngx_wasm_module/src/*" --output-file lcov.info
143+
;;
144+
*)
145+
lcov --gcov-tool gcov-${CC#*-} --ignore-errors source --capture --directory work/buildroot --output-file lcov.info
146+
lcov --ignore-errors unused --gcov-tool gcov-${CC#*-} --remove lcov.info "*/ngx_wasm_module/src/common/debug/*" --output-file lcov.info
147+
lcov --gcov-tool gcov-${CC#*-} --extract lcov.info "*/ngx_wasm_module/src/*" --output-file lcov.info
148+
;;
149+
esac
150+
151+
name="valgrind"
152+
if [ -n "${{ inputs.openresty }}" ]; then
153+
name="$name-openresty_${{ inputs.openresty }}"
154+
else
155+
name="$name-ngx_${{ inputs.ngx }}"
156+
fi
157+
name="$name-${{ inputs.runtime }}"
158+
name="$name-${{ inputs.ipc }}"
159+
name="$name-${{ inputs.ssl }}"
160+
name="$name-${{ inputs.debug }}"
161+
name="$name-${{ inputs.hup }}"
162+
if [ "${{ inputs.module_type }}" = dynamic ]; then
163+
name="$name-dynamic"
164+
else
165+
name="$name-static"
166+
fi
167+
if [ -n "${{ inputs.wasm_target }}" ]; then
168+
name="$name-${{ inputs.wasm_target }}"
169+
fi
170+
echo "name=$name" >> $GITHUB_OUTPUT
171+
- name: Coveralls Upload
172+
if: ${{ !env.ACT && inputs.coverage }}
173+
uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # v2
174+
with:
175+
github-token: ${{ secrets.GITHUB_TOKEN }}
176+
flag-name: ${{ steps.lcov.outputs.name }}
177+
path-to-lcov: './lcov.info'
178+
parallel: true
140179
- name: Codecov Upload
141180
if: ${{ !env.ACT && inputs.coverage }}
142181
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
143182
with:
144183
token: ${{ secrets.CODECOV_TOKEN }}
145184
files: './lcov.info'
146-
flags: valgrind
185+
flags: ${{ steps.lcov.outputs.name }}
147186
- run: rm -f t/servroot/html/nginx.sock
148187
if: ${{ failure() && !env.ACT }}
149188
- uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)