Skip to content

Commit

Permalink
chore(ci) add code coverage for Valgrind jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed Dec 2, 2023
1 parent a278bb7 commit 3d61ca1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ jobs:
hup: ${{ matrix.hup }}
debug: ${{ matrix.debug }}
path: ${{ matrix.path }}
coverage: true
secrets: inherit

lint:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/job-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: './lcov.info'
flags: unit
- run: rm -f t/servroot/html/nginx.sock
if: ${{ failure() && !env.ACT }}
- uses: actions/upload-artifact@v2
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/job-valgrind-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ env:
CC: ${{ inputs.cc }}
NGX: ${{ inputs.ngx }}
NGX_BUILD_OPENRESTY: ${{ inputs.openresty }}
NGX_BUILD_GCOV: ${{ inputs.coverage && 1 || 0 }}
NGX_BUILD_DEBUG: ${{ inputs.debug == 'debug' && 1 || 0 }}
NGX_BUILD_CC_OPT: '-O2'
NGX_BUILD_NOPOOL: 1
Expand All @@ -67,7 +68,9 @@ jobs:
runs-on: ${{ inputs.os }}
timeout-minutes: 150
steps:
- run: sudo apt-get update && sudo apt-get install -y valgrind
- name: 'Setup deps - apt-get'
if: ${{ contains(inputs.os, 'ubuntu') }}
run: sudo apt-get update && sudo apt-get install -y valgrind ${CC} libstdc++-${CC#*-}-dev lcov
- uses: actions/checkout@v3
- name: 'Setup cache - rustup toolchain'
uses: actions/cache@v3
Expand Down Expand Up @@ -123,6 +126,19 @@ jobs:
cat valgrind.log >&2
exit 1
fi
- name: Run lcov
if: ${{ !env.ACT && inputs.coverage }}
run: |
lcov --gcov-tool gcov-${CC#*-} --capture --directory work/buildroot --output-file lcov.info
lcov --gcov-tool gcov-${CC#*-} --remove lcov.info "*/ngx_wasm_module/src/common/debug/*" --output-file lcov.info
lcov --gcov-tool gcov-${CC#*-} --extract lcov.info "*/ngx_wasm_module/src/*" --output-file lcov.info
- name: Codecov Upload
if: ${{ !env.ACT && inputs.coverage }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: './lcov.info'
flags: valgrind
- run: rm -f t/servroot/html/nginx.sock
if: ${{ failure() && !env.ACT }}
- uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 3d61ca1

Please sign in to comment.