Commit 1ab7c43a221df952dbdad20cc228e050c6379926

Authored by Jay Berkenbilt
1 parent c1a48ec8

Support CodeCov

.github/workflows/main.yml
... ... @@ -123,6 +123,17 @@ jobs:
123 123 - uses: actions/checkout@v3
124 124 - name: 'Sanitizer Tests'
125 125 run: build-scripts/test-sanitizers
  126 + CodeCov:
  127 + runs-on: ubuntu-latest
  128 + needs: Prebuild
  129 + steps:
  130 + - uses: actions/checkout@v3
  131 + - name: 'Code Coverage'
  132 + run: build-scripts/test-coverage
  133 + - name: Upload coverage reports to Codecov
  134 + uses: codecov/codecov-action@v4
  135 + with:
  136 + token: ${{ secrets.CODECOV_TOKEN }}
126 137 QuickJobs:
127 138 runs-on: ubuntu-latest
128 139 needs: Prebuild
... ...
README.md
... ... @@ -3,6 +3,7 @@
3 3 [![QPDF](logo/qpdf.svg)](https://qpdf.sourceforge.io)
4 4  
5 5 [![QPDF Build](https://github.com/qpdf/qpdf/workflows/QPDF%20Build/badge.svg)](https://github.com/qpdf/qpdf/actions)
  6 +[![codecov](https://codecov.io/gh/qpdf/qpdf/graph/badge.svg?token=ODijhBtAoW)](https://codecov.io/gh/qpdf/qpdf)
6 7 [![Documentation Status](https://readthedocs.org/projects/qpdf/badge/?version=latest)](https://qpdf.readthedocs.io/en/latest/?badge=latest)
7 8  
8 9 QPDF is a command-line tool and C++ library that performs content-preserving transformations on PDF files. It supports linearization, encryption, and numerous other features. It can also be used for splitting and merging files, creating PDF files (but you have to supply all the content yourself), and inspecting files for study or analysis. QPDF does not render PDFs or perform text extraction, and it does not contain higher-level interfaces for working with page contents. It is a low-level tool for working with the structure of PDF files and can be a valuable tool for anyone who wants to do programmatic or command-line-based manipulation of PDF files.
... ...
build-scripts/test-coverage 0 → 100755
  1 +#!/bin/bash
  2 +set -e
  3 +sudo apt-get update
  4 +sudo apt-get -y install \
  5 + build-essential cmake lcov \
  6 + zlib1g-dev libjpeg-dev libgnutls28-dev libssl-dev
  7 +cmake -S . -B build \
  8 + -DCI_MODE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Debug \
  9 + -DREQUIRE_CRYPTO_OPENSSL=1 -DREQUIRE_CRYPTO_GNUTLS=1 \
  10 + -DENABLE_QTC=1 -DENABLE_COVERAGE=ON
  11 +cmake --build build --verbose -j$(nproc) -- -k
  12 +(cd build; ctest --verbose)
  13 +lcov --capture --directory . --output-file coverage.info
  14 +lcov --remove coverage.info '/usr/*' --output-file coverage.info
  15 +lcov --list coverage.info
... ...
codecov.yml 0 → 100644
  1 +# When modifying this file, please validate using
  2 +# curl -X POST --data-binary @codecov.yml https://codecov.io/validate
  3 +
  4 +coverage:
  5 + status:
  6 + project:
  7 + default:
  8 + informational: true
  9 + patch:
  10 + default:
  11 + informational: true
... ...