From e4bb71c9fb50b90c553e74abb125ce1f440a2eb1 Mon Sep 17 00:00:00 2001 From: apolisskyi Date: Wed, 18 Oct 2023 18:46:39 +0300 Subject: [PATCH] Tests coverage: add codecov --- .github/workflows/ci.yml | 9 ++++++++- .gitignore | 1 + test/Makefile | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fae578f..715a706 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: force_orphan: true publish_branch: gh-pages - run-tests: + run-tests-with-coverage: runs-on: ubuntu-latest steps: - name: Checkout code @@ -43,3 +43,10 @@ jobs: run: sudo apt-get install gcc make - name: Run tests run: make -C test tests + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + gcov: true + working-directory: src + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 45e82d8..1854052 100755 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ html # test coverage *.gcda *.gcno +*.gcov # Linker output *.ilk diff --git a/test/Makefile b/test/Makefile index b48a99d..b6b0453 100755 --- a/test/Makefile +++ b/test/Makefile @@ -1,5 +1,5 @@ # Compiler -CC = gcc -std=c99 #-Wall -Wextra -Werror -pedantic -g +CC = gcc -std=c99 -fprofile-arcs -ftest-coverage -O0 #-Wall -Wextra -Werror -pedantic -g # Directories SRC_DIR = ../src