From bf037c1f3b8d08f59764811886115d2026f05844 Mon Sep 17 00:00:00 2001 From: Stefan <29021710+Saalvage@users.noreply.github.com> Date: Thu, 20 Jan 2022 13:06:51 +0100 Subject: Fix coverage (#594) * Run with coverage * Epic checkout failure * Install Ninja * lcov * Install LCOV * Use cd * . * G * ??? * Replace fake unicode characters * Add coveralls * Setup base-path * cmake flag hack? * Proper inclusion * Proper inclusion (for real this time!) * Try compile using gcc over clang? * Specify build type * Try fix * coveralls -> codecov * Remove redundant stuff * Fix typo * README codecov * Remove CODE_COVERAGE CMake flag * Remove missed endif() * Readd tests * Fix codecov href * Readd empty lines * Fix whitespace * Update Patreon logo * Update donate buttons * Update donate buttons --- .github/workflows/main.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to '.github') diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8381c553..59957e7e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,36 @@ env: CTEST_PARALLEL_LEVEL: 2 jobs: + coverage: + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install + run: sudo apt-get install -y ninja-build lcov + + - name: Generate + run: cmake -B build -S . -G Ninja -D CMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage" + + - name: Build + run: cmake --build build + + - name: Test + run: ctest --test-dir build --no-tests=error + + - name: LCOV + run: | + mkdir coverage + lcov -c -d build/ -o coverage/lcov.info --include "*doctest/parts*" + + - name: Codecov + uses: codecov/codecov-action@v2 + with: + files: ./coverage/lcov.info + fail_ci_if_error: true + ci: if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository runs-on: ${{ matrix.os }} -- cgit v1.2.3