mirror of
https://github.com/openstreetmap/mod_tile.git
synced 2026-01-09 14:17:29 +00:00
Report coverage for latest Mapnik as well (#375)
_Also_: * Don't build unneeded `latest` Mapnik `benchmarks`/`demos`/`utilities`
This commit is contained in:
28
.github/actions/coverage/action.yml
vendored
Normal file
28
.github/actions/coverage/action.yml
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
inputs:
|
||||
lcov-extra-options:
|
||||
default: ""
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Process `mod_tile` coverage results
|
||||
run: |
|
||||
ctest -T coverage || true
|
||||
lcov ${{ inputs.lcov-extra-options }} \
|
||||
--capture \
|
||||
--directory . \
|
||||
--output-file coverage.info
|
||||
lcov ${{ inputs.lcov-extra-options }} \
|
||||
--output-file coverage.info \
|
||||
--remove coverage.info \
|
||||
"${GITHUB_WORKSPACE}/includes/catch/catch.hpp" \
|
||||
"${GITHUB_WORKSPACE}/src/gen_tile_test.cpp" \
|
||||
"/usr/*"
|
||||
working-directory: build
|
||||
shell: bash --noprofile --norc -euxo pipefail {0}
|
||||
|
||||
- name: Report `mod_tile` coverage results to `codecov.io`
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: build/coverage.info
|
||||
@ -9,7 +9,7 @@ runs:
|
||||
path: |
|
||||
mapnik-build
|
||||
mapnik-src
|
||||
key: ${{ matrix.image }}-${{ matrix.compiler }}-mapnik-latest
|
||||
key: ${{ matrix.image || matrix.os || github.job }}-${{ matrix.compiler }}-mapnik-latest
|
||||
|
||||
- name: Checkout `Mapnik`
|
||||
uses: actions/checkout@v4
|
||||
@ -23,8 +23,17 @@ runs:
|
||||
run: |
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=${BUILD_PARALLEL_LEVEL:-$(nproc)}
|
||||
cmake -B mapnik-build -S mapnik-src \
|
||||
-DBUILD_BENCHMARK:BOOL=OFF \
|
||||
-DBUILD_DEMO_CPP:BOOL=OFF \
|
||||
-DBUILD_DEMO_VIEWER:BOOL=OFF \
|
||||
-DBUILD_TESTING:BOOL=OFF \
|
||||
-DBUILD_UTILITY_GEOMETRY_TO_WKB:BOOL=OFF \
|
||||
-DBUILD_UTILITY_MAPNIK_INDEX:BOOL=OFF \
|
||||
-DBUILD_UTILITY_MAPNIK_RENDER:BOOL=OFF \
|
||||
-DBUILD_UTILITY_OGRINDEX:BOOL=OFF \
|
||||
-DBUILD_UTILITY_PGSQL2SQLITE:BOOL=OFF \
|
||||
-DBUILD_UTILITY_SHAPEINDEX:BOOL=OFF \
|
||||
-DBUILD_UTILITY_SVG2PNG:BOOL=OFF \
|
||||
-DCMAKE_BUILD_TYPE:STRING=Release \
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=/usr
|
||||
cmake --build mapnik-build
|
||||
@ -32,5 +41,5 @@ runs:
|
||||
if: steps.cache-mapnik.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Install `Mapnik`
|
||||
run: cmake --install mapnik-build
|
||||
run: ${{ !matrix.image && 'sudo' || '' }} cmake --install mapnik-build
|
||||
shell: bash --noprofile --norc -euxo pipefail {0}
|
||||
|
||||
@ -321,7 +321,7 @@ runs:
|
||||
uses: ./.github/actions/dependencies/build-and-install/mapnik/latest
|
||||
if: |
|
||||
matrix.mapnik_latest &&
|
||||
(startsWith(matrix.image, 'debian:') || startsWith(matrix.image, 'ubuntu:'))
|
||||
(startsWith(matrix.image, 'debian:') || startsWith(matrix.image, 'ubuntu:') || runner.os == 'Linux')
|
||||
|
||||
- name: Build & Install latest `mapnik` (openSUSE)
|
||||
uses: ./.github/actions/dependencies/build-and-install/mapnik/latest
|
||||
|
||||
61
.github/workflows/coverage.yml
vendored
61
.github/workflows/coverage.yml
vendored
@ -11,12 +11,22 @@ on:
|
||||
|
||||
jobs:
|
||||
Coverage:
|
||||
name: Build, Test & Report Coverage
|
||||
name: >-
|
||||
Build, Test & Report Coverage
|
||||
${{ matrix.mapnik_latest && '(Latest Mapnik)' || '' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
BUILD_TYPE: Debug
|
||||
CFLAGS: --coverage
|
||||
CXXFLAGS: --coverage
|
||||
strategy:
|
||||
matrix:
|
||||
compiler:
|
||||
- GNU
|
||||
mapnik_latest:
|
||||
- false
|
||||
- true
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@ -24,11 +34,23 @@ jobs:
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/dependencies/install
|
||||
with:
|
||||
ubuntu-test-dependencies: >-
|
||||
apache2
|
||||
jq
|
||||
lcov
|
||||
memcached
|
||||
ubuntu-mapnik-latest-build-dependencies: >-
|
||||
cmake
|
||||
git
|
||||
libboost-filesystem-dev
|
||||
libboost-program-options-dev
|
||||
libboost-regex-dev
|
||||
libfreetype6-dev
|
||||
libgdal-dev
|
||||
libharfbuzz-dev
|
||||
libicu-dev
|
||||
libjpeg-dev
|
||||
libpq-dev
|
||||
libproj-dev
|
||||
libsqlite3-dev
|
||||
libtiff-dev
|
||||
libwebp-dev
|
||||
libxml2-dev
|
||||
|
||||
- name: Build `mod_tile`
|
||||
uses: ./.github/actions/cmake/build
|
||||
@ -36,31 +58,20 @@ jobs:
|
||||
- name: Test `mod_tile`
|
||||
uses: ./.github/actions/cmake/test
|
||||
|
||||
- name: Process `mod_tile` coverage results
|
||||
run: |
|
||||
lcov \
|
||||
--capture \
|
||||
--directory . \
|
||||
--output-file coverage.info
|
||||
lcov \
|
||||
--output-file coverage.info \
|
||||
--remove coverage.info \
|
||||
"${GITHUB_WORKSPACE}/includes/catch/catch.hpp" \
|
||||
"${GITHUB_WORKSPACE}/src/gen_tile_test.cpp" \
|
||||
"/usr/*"
|
||||
genhtml coverage.info --output-directory coverage
|
||||
working-directory: build
|
||||
- name: Process & Report `mod_tile` coverage results
|
||||
uses: ./.github/actions/coverage
|
||||
|
||||
- name: Write coverage summary to `$GITHUB_STEP_SUMMARY`
|
||||
run: lcov --summary build/coverage.info | sed 's/^ /* /g' >> ${GITHUB_STEP_SUMMARY}
|
||||
|
||||
- name: Generate `mod_tile` coverage results artifact
|
||||
run: |
|
||||
mkdir -p coverage
|
||||
genhtml coverage.info --output-directory coverage/${{ matrix.mapnik_latest && 'mapnik_latest' || 'mapnik' }}
|
||||
working-directory: build
|
||||
|
||||
- name: Upload `mod_tile` coverage results artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Coverage Results
|
||||
path: build/coverage
|
||||
|
||||
- name: Report `mod_tile` coverage results to `codecov.io`
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: build/coverage.info
|
||||
|
||||
Reference in New Issue
Block a user