aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2024-02-18 00:34:30 +0100
committerJay Berkenbilt <ejb@ql.org>2024-02-18 00:34:30 +0100
commit1ab7c43a221df952dbdad20cc228e050c6379926 (patch)
tree462519ec59b42b7925d2871c20b00501da00a12f
parentc1a48ec81dfd7252c7f414257c16b5bc522f97f5 (diff)
downloadqpdf-1ab7c43a221df952dbdad20cc228e050c6379926.tar.zst
Support CodeCov
-rw-r--r--.github/workflows/main.yml11
-rw-r--r--README.md1
-rwxr-xr-xbuild-scripts/test-coverage15
-rw-r--r--codecov.yml11
4 files changed, 38 insertions, 0 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index f945a578..92caadd9 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -123,6 +123,17 @@ jobs:
- uses: actions/checkout@v3
- name: 'Sanitizer Tests'
run: build-scripts/test-sanitizers
+ CodeCov:
+ runs-on: ubuntu-latest
+ needs: Prebuild
+ steps:
+ - uses: actions/checkout@v3
+ - name: 'Code Coverage'
+ run: build-scripts/test-coverage
+ - name: Upload coverage reports to Codecov
+ uses: codecov/codecov-action@v4
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
QuickJobs:
runs-on: ubuntu-latest
needs: Prebuild
diff --git a/README.md b/README.md
index 07e1ee03..aac4ef9b 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,7 @@
[![QPDF](logo/qpdf.svg)](https://qpdf.sourceforge.io)
[![QPDF Build](https://github.com/qpdf/qpdf/workflows/QPDF%20Build/badge.svg)](https://github.com/qpdf/qpdf/actions)
+[![codecov](https://codecov.io/gh/qpdf/qpdf/graph/badge.svg?token=ODijhBtAoW)](https://codecov.io/gh/qpdf/qpdf)
[![Documentation Status](https://readthedocs.org/projects/qpdf/badge/?version=latest)](https://qpdf.readthedocs.io/en/latest/?badge=latest)
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.
diff --git a/build-scripts/test-coverage b/build-scripts/test-coverage
new file mode 100755
index 00000000..fc2f2fbd
--- /dev/null
+++ b/build-scripts/test-coverage
@@ -0,0 +1,15 @@
+#!/bin/bash
+set -e
+sudo apt-get update
+sudo apt-get -y install \
+ build-essential cmake lcov \
+ zlib1g-dev libjpeg-dev libgnutls28-dev libssl-dev
+cmake -S . -B build \
+ -DCI_MODE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Debug \
+ -DREQUIRE_CRYPTO_OPENSSL=1 -DREQUIRE_CRYPTO_GNUTLS=1 \
+ -DENABLE_QTC=1 -DENABLE_COVERAGE=ON
+cmake --build build --verbose -j$(nproc) -- -k
+(cd build; ctest --verbose)
+lcov --capture --directory . --output-file coverage.info
+lcov --remove coverage.info '/usr/*' --output-file coverage.info
+lcov --list coverage.info
diff --git a/codecov.yml b/codecov.yml
new file mode 100644
index 00000000..05cc35f3
--- /dev/null
+++ b/codecov.yml
@@ -0,0 +1,11 @@
+# When modifying this file, please validate using
+# curl -X POST --data-binary @codecov.yml https://codecov.io/validate
+
+coverage:
+ status:
+ project:
+ default:
+ informational: true
+ patch:
+ default:
+ informational: true