From 7ced543d39a3d89d8a0e4359397c839b549118eb Mon Sep 17 00:00:00 2001 From: "NDC\\rjbrown6" Date: Tue, 7 Jan 2025 10:48:50 -0500 Subject: [PATCH] [nasa/nos3#407] Update Workflow For Coverage --- .github/workflows/build.yml | 39 +++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb2f932a..4425273b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,16 +46,47 @@ jobs: with: fetch-depth: 1 submodules: recursive + - name: Configure Safe Directory + run: git config --global --add safe.directory $GITHUB_WORKSPACE - name: Update run: apt-get update - name: install dependencies - run: apt-get install -y gcc lcov + run: apt-get install -y gcc lcov gcovr bc - name: config run: make config - name: build-test - run: make build-test - - name: Generate Coverage Report - run: make gcov + run: | + export CFLAGS="-fprofile-arcs -ftest-coverage -fcondition-coverage -g" + make build-test + # - name: Generate Coverage Report + # run: make gcov + - name: Generate Coverage Report and Badges + run: | + mkdir -p docs/coverage + gcovr --verbose --txt-metric branch --xml-pretty --exclude-unreachable-branches -o docs/coverage/coverage_report.xml + gcovr --verbose --txt-metric branch --html --html-details -o docs/coverage/coverage_report.html + LINE_COVERAGE=$(grep -oP '(?<=