From 8b5390e67952b378b75cb15145eaae179696d5ec Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Fri, 9 Jan 2026 14:20:39 +0000 Subject: [PATCH 1/3] Add CI run to gather code coverage --- .github/workflows/test.yml | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1224b15..63fab2a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,3 +51,50 @@ jobs: run: | pytest -v + coverage: + name: 'Test coverage' + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Create micromamba environment + uses: mamba-org/setup-micromamba@main + with: + environment-file: dev-environment.yml + cache-environment: true + create-args: lcov + + - name: Configure CMake + run: | + cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG="-g -O0 --coverage" + + - name: Build with CMake + working-directory: build + run: cmake --build . --parallel 8 + + - name: Run tests + run: | + pytest -v + + - name: Collect C++ coverage + run: | + lcov --version + lcov --output-file coverage.lcov --directory . --capture + lcov --output-file coverage.lcov --extract coverage.lcov '*/git2cpp/src/*' + genhtml coverage.lcov --output-directory outdir + + - name: Upload artifact containing coverage report + uses: actions/upload-artifact@v6 + with: + name: coverage_report + path: outdir + + #- name: Upload coverage to codecov + # uses: codecov/codecov-action@v5 + # with: + # files: coverage.lcov + # token: ${{ secrets.CODECOV_TOKEN }} + # verbose: true From 64a186c95ec062bb5c925b1940cb92b45dee40d2 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Thu, 19 Feb 2026 10:33:18 +0000 Subject: [PATCH 2/3] Upload to codecov --- .github/workflows/test.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 63fab2a..c329a9a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -92,9 +92,8 @@ jobs: name: coverage_report path: outdir - #- name: Upload coverage to codecov - # uses: codecov/codecov-action@v5 - # with: - # files: coverage.lcov - # token: ${{ secrets.CODECOV_TOKEN }} - # verbose: true + - name: Upload coverage to codecov + uses: codecov/codecov-action@v5 + with: + files: coverage.lcov + verbose: true From a1dbcba443646869a464f6d7596d6692cf860040 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Thu, 19 Feb 2026 10:43:06 +0000 Subject: [PATCH 3/3] Use CODECOV_TOKEN --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c329a9a..c760934 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -96,4 +96,5 @@ jobs: uses: codecov/codecov-action@v5 with: files: coverage.lcov + token: ${{ secrets.CODECOV_TOKEN }} verbose: true