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