Skip to content

Commit a0a1092

Browse files
authored
Report coverage for latest Mapnik as well (#375)
_Also_: * Don't build unneeded `latest` Mapnik `benchmarks`/`demos`/`utilities`
1 parent b3c19c1 commit a0a1092

4 files changed

Lines changed: 76 additions & 28 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
inputs:
3+
lcov-extra-options:
4+
default: ""
5+
6+
runs:
7+
using: composite
8+
steps:
9+
- name: Process `mod_tile` coverage results
10+
run: |
11+
ctest -T coverage || true
12+
lcov ${{ inputs.lcov-extra-options }} \
13+
--capture \
14+
--directory . \
15+
--output-file coverage.info
16+
lcov ${{ inputs.lcov-extra-options }} \
17+
--output-file coverage.info \
18+
--remove coverage.info \
19+
"${GITHUB_WORKSPACE}/includes/catch/catch.hpp" \
20+
"${GITHUB_WORKSPACE}/src/gen_tile_test.cpp" \
21+
"/usr/*"
22+
working-directory: build
23+
shell: bash --noprofile --norc -euxo pipefail {0}
24+
25+
- name: Report `mod_tile` coverage results to `codecov.io`
26+
uses: codecov/codecov-action@v3
27+
with:
28+
files: build/coverage.info

.github/actions/dependencies/build-and-install/mapnik/latest/action.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ runs:
99
path: |
1010
mapnik-build
1111
mapnik-src
12-
key: ${{ matrix.image }}-${{ matrix.compiler }}-mapnik-latest
12+
key: ${{ matrix.image || matrix.os || github.job }}-${{ matrix.compiler }}-mapnik-latest
1313

1414
- name: Checkout `Mapnik`
1515
uses: actions/checkout@v4
@@ -23,14 +23,23 @@ runs:
2323
run: |
2424
export CMAKE_BUILD_PARALLEL_LEVEL=${BUILD_PARALLEL_LEVEL:-$(nproc)}
2525
cmake -B mapnik-build -S mapnik-src \
26+
-DBUILD_BENCHMARK:BOOL=OFF \
27+
-DBUILD_DEMO_CPP:BOOL=OFF \
2628
-DBUILD_DEMO_VIEWER:BOOL=OFF \
2729
-DBUILD_TESTING:BOOL=OFF \
30+
-DBUILD_UTILITY_GEOMETRY_TO_WKB:BOOL=OFF \
31+
-DBUILD_UTILITY_MAPNIK_INDEX:BOOL=OFF \
32+
-DBUILD_UTILITY_MAPNIK_RENDER:BOOL=OFF \
33+
-DBUILD_UTILITY_OGRINDEX:BOOL=OFF \
34+
-DBUILD_UTILITY_PGSQL2SQLITE:BOOL=OFF \
35+
-DBUILD_UTILITY_SHAPEINDEX:BOOL=OFF \
36+
-DBUILD_UTILITY_SVG2PNG:BOOL=OFF \
2837
-DCMAKE_BUILD_TYPE:STRING=Release \
2938
-DCMAKE_INSTALL_PREFIX:PATH=/usr
3039
cmake --build mapnik-build
3140
shell: bash --noprofile --norc -euxo pipefail {0}
3241
if: steps.cache-mapnik.outputs.cache-hit != 'true'
3342

3443
- name: Install `Mapnik`
35-
run: cmake --install mapnik-build
44+
run: ${{ !matrix.image && 'sudo' || '' }} cmake --install mapnik-build
3645
shell: bash --noprofile --norc -euxo pipefail {0}

.github/actions/dependencies/install/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ runs:
321321
uses: ./.github/actions/dependencies/build-and-install/mapnik/latest
322322
if: |
323323
matrix.mapnik_latest &&
324-
(startsWith(matrix.image, 'debian:') || startsWith(matrix.image, 'ubuntu:'))
324+
(startsWith(matrix.image, 'debian:') || startsWith(matrix.image, 'ubuntu:') || runner.os == 'Linux')
325325
326326
- name: Build & Install latest `mapnik` (openSUSE)
327327
uses: ./.github/actions/dependencies/build-and-install/mapnik/latest

.github/workflows/coverage.yml

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,56 +11,67 @@ on:
1111

1212
jobs:
1313
Coverage:
14-
name: Build, Test & Report Coverage
14+
name: >-
15+
Build, Test & Report Coverage
16+
${{ matrix.mapnik_latest && '(Latest Mapnik)' || '' }}
1517
runs-on: ubuntu-latest
1618
env:
1719
BUILD_TYPE: Debug
1820
CFLAGS: --coverage
1921
CXXFLAGS: --coverage
22+
strategy:
23+
matrix:
24+
compiler:
25+
- GNU
26+
mapnik_latest:
27+
- false
28+
- true
29+
fail-fast: false
2030
steps:
2131
- name: Checkout code
2232
uses: actions/checkout@v4
2333

2434
- name: Install dependencies
2535
uses: ./.github/actions/dependencies/install
2636
with:
27-
ubuntu-test-dependencies: >-
28-
apache2
29-
jq
30-
lcov
31-
memcached
37+
ubuntu-mapnik-latest-build-dependencies: >-
38+
cmake
39+
git
40+
libboost-filesystem-dev
41+
libboost-program-options-dev
42+
libboost-regex-dev
43+
libfreetype6-dev
44+
libgdal-dev
45+
libharfbuzz-dev
46+
libicu-dev
47+
libjpeg-dev
48+
libpq-dev
49+
libproj-dev
50+
libsqlite3-dev
51+
libtiff-dev
52+
libwebp-dev
53+
libxml2-dev
3254
3355
- name: Build `mod_tile`
3456
uses: ./.github/actions/cmake/build
3557

3658
- name: Test `mod_tile`
3759
uses: ./.github/actions/cmake/test
3860

39-
- name: Process `mod_tile` coverage results
40-
run: |
41-
lcov \
42-
--capture \
43-
--directory . \
44-
--output-file coverage.info
45-
lcov \
46-
--output-file coverage.info \
47-
--remove coverage.info \
48-
"${GITHUB_WORKSPACE}/includes/catch/catch.hpp" \
49-
"${GITHUB_WORKSPACE}/src/gen_tile_test.cpp" \
50-
"/usr/*"
51-
genhtml coverage.info --output-directory coverage
52-
working-directory: build
61+
- name: Process & Report `mod_tile` coverage results
62+
uses: ./.github/actions/coverage
5363

5464
- name: Write coverage summary to `$GITHUB_STEP_SUMMARY`
5565
run: lcov --summary build/coverage.info | sed 's/^ /* /g' >> ${GITHUB_STEP_SUMMARY}
5666

67+
- name: Generate `mod_tile` coverage results artifact
68+
run: |
69+
mkdir -p coverage
70+
genhtml coverage.info --output-directory coverage/${{ matrix.mapnik_latest && 'mapnik_latest' || 'mapnik' }}
71+
working-directory: build
72+
5773
- name: Upload `mod_tile` coverage results artifact
5874
uses: actions/upload-artifact@v3
5975
with:
6076
name: Coverage Results
6177
path: build/coverage
62-
63-
- name: Report `mod_tile` coverage results to `codecov.io`
64-
uses: codecov/codecov-action@v3
65-
with:
66-
files: build/coverage.info

0 commit comments

Comments
 (0)