From 12756f0169c4d06b0abdc69be662d685f490e25e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Fri, 21 Feb 2020 20:15:15 +0100 Subject: [PATCH] coverage test --- .github/workflows/coverage.yml | 96 ++++++++++++++++++++++++++++------ 1 file changed, 80 insertions(+), 16 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 228947db..be907d02 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,32 +1,96 @@ -name: Coverage + +name: Coverage Report on: push: branches: - '**' - '!gh-pages' + pull_request: + branches: + - '**' + - '!gh-pages' jobs: build: - name: ${{ matrix.cc }} ${{ matrix.double && 'double' || 'float'}} runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[skip ci]')" - strategy: - matrix: - cc: [gcc, clang] - double: [0, 1] steps: - - name: Build Gwion - uses: fennecdjay/gwion-action@v4 + - uses: fennecdjay/gwion-action@v4 with: - USE: ${{ matrix.double }} - RUN: true + dir: . + ref: ${ github.head } env: - CC: ${{ matrix.cc }} USE_COVERAGE: 1 - CFLAGS: -fsanitize=address -fno-omit-frame-pointer - LDFLAGS: -fsanitize=address -fno-omit-frame-pointer - VALGRIND: NO_VALGRIND - USE_MEMCHECK: 0 - SEVERITY: 3 + + - uses: actions/setup-python@v1 + with: + python-version: '3.x' + + - name: Install gcovr + run: | + pip install git+https://github.com/gcovr/gcovr.git + + - name: Clone report repo + run: git clone https://github.com/fennecdjay/gwion-coverage-report + + - name: Generate Report + run: | + printf '# Gwion coverage\n```\n' > gwion-coverage-report/README.md + gcovr -s --filter '.*\.c$' src >> gwion-coverage-report/README.md + printf '```\n' >> gwion-coverage-report/README.md + COV_TXT=$(gcovr -s --html-details index.html --html-title "Gwion coverage report" --filter '.*\.c$' src | grep lines | cut -d" " -f2) + COV_NUM=${COV_TXT: : -1} + echo $COV_NUM > gwion-coverage-report/coverage_num.txt + sed -i 's//