Skip to content

Commit 521e47b

Browse files
authored
Backport various CI & documentation changes to v0.7.x (#443)
* Support for Mapnik >= 4 no longer using boost:optional * Backport Address macOS build errors in src/render_submit_queue.c * Backport GitHub Actions workflows and actions * Backport cmake, docker & docs/build directories * Backport changes to CMakeLists.txt
1 parent 5d18f51 commit 521e47b

45 files changed

Lines changed: 540 additions & 611 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/autotools/install/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ runs:
33
using: composite
44
steps:
55
- name: Run `make install`
6-
run: make install
6+
run: ${{ !matrix.image && 'sudo -E' || '' }} make install
77
shell: bash --noprofile --norc -euxo pipefail {0}
88

99
- name: Run `make install-mod_tile`
10-
run: make install-mod_tile
10+
run: ${{ !matrix.image && 'sudo -E' || '' }} make install-mod_tile
1111
shell: bash --noprofile --norc -euxo pipefail {0}

.github/actions/cmake/build/action.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@
22
runs:
33
using: composite
44
steps:
5-
- name: Create `cmake` symbolic link
6-
run: |
7-
if ! command -v cmake &> /dev/null && command -v cmake3 &> /dev/null; then
8-
ln --symbolic cmake3 /usr/bin/cmake
9-
fi
10-
shell: bash --noprofile --norc -euxo pipefail {0}
11-
125
- name: Prepare `build` directory
136
run: |
147
cmake -B build -S . \
158
-LA \
169
-DCMAKE_BUILD_TYPE:STRING=${BUILD_TYPE:-Release} \
17-
-DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_PREFIX:-/usr/local} \
10+
-DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${INSTALL_LOCALSTATEDIR:-/var} \
11+
-DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_PREFIX:-/usr} \
12+
-DCMAKE_INSTALL_RUNSTATEDIR:PATH=${INSTALL_RUNSTATEDIR:-/run} \
13+
-DCMAKE_INSTALL_SYSCONFDIR:PATH=${INSTALL_SYSCONFDIR:-/etc} \
1814
-DENABLE_TESTS:BOOL=ON
1915
shell: bash --noprofile --norc -euxo pipefail {0}
2016

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
runs:
3+
using: composite
4+
steps:
5+
- name: Set `CPACK_PACKAGE_FILE_NAME`
6+
run: |
7+
echo "CPACK_PACKAGE_FILE_NAME=mod_tile-${GITHUB_SHA}-$(echo ${{ matrix.image || matrix.os || matrix.box_generic || github.job }}-${{ matrix.build_system }}-${{ matrix.compiler }} | sed 's/[^0-9a-zA-Z-]/_/g')" >> ${GITHUB_ENV}
8+
shell: bash --noprofile --norc -euxo pipefail {0}
9+
10+
- name: Set `CPACK_OPTIONS`
11+
run: |
12+
if command -v dpkg; then
13+
echo "CPACK_OPTIONS= -G DEB" >> ${GITHUB_ENV}
14+
elif command -v rpm; then
15+
echo "CPACK_OPTIONS=-G RPM" >> ${GITHUB_ENV}
16+
elif [ -f /etc/os-release ]; then
17+
source /etc/os-release
18+
if [ "$ID" = "freebsd" ]; then
19+
echo "CPACK_OPTIONS=-D CPACK_SET_DESTDIR=1 -G FREEBSD" >> ${GITHUB_ENV}
20+
fi
21+
elif [[ ${OSTYPE} == 'darwin'* ]]; then
22+
echo "CPACK_OPTIONS=-D CPACK_SET_DESTDIR=1 -G DragNDrop" >> ${GITHUB_ENV}
23+
else
24+
echo "CPACK_OPTIONS=-D CPACK_SET_DESTDIR=1 -G TGZ" >> ${GITHUB_ENV}
25+
fi
26+
shell: bash --noprofile --norc -euxo pipefail {0}
27+
28+
- name: Package `mod_tile`
29+
run: |
30+
${{ !matrix.image && 'sudo' || '' }} cpack ${CPACK_OPTIONS} \
31+
-D CPACK_PACKAGE_FILE_NAME="${CPACK_PACKAGE_FILE_NAME}" || true
32+
shell: bash --noprofile --norc -euxo pipefail {0}
33+
working-directory: build
34+
35+
- name: Upload `mod_tile` package artifact
36+
uses: actions/upload-artifact@v4
37+
with:
38+
if-no-files-found: ignore
39+
name: Package Artifacts - ${{ env.CPACK_PACKAGE_FILE_NAME }}${{ matrix.mapnik_latest && ' (Latest Mapnik)' || '' }}
40+
path: |
41+
build/${{ env.CPACK_PACKAGE_FILE_NAME }}.*
42+
retention-days: 14
Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,27 @@
11
---
2+
inputs:
3+
options:
4+
default: --exclude-regex 'clear_dirs_.+|remove_tile_.+' --output-on-failure
5+
26
runs:
37
using: composite
48
steps:
5-
- name: Create `ctest` symbolic link
6-
run: |
7-
if ! command -v ctest &> /dev/null && command -v ctest3 &> /dev/null; then
8-
ln --symbolic ctest3 /usr/bin/ctest
9-
fi
10-
shell: bash --noprofile --norc -euxo pipefail {0}
11-
129
- name: Test `mod_tile`
13-
run: ctest --exclude-regex 'clear_dirs|remove_tiles' --output-on-failure
10+
run: |
11+
export CTEST_PARALLEL_LEVEL=${TEST_PARALLEL_LEVEL:-$(nproc)}
12+
ctest ${{ inputs.options }}
1413
shell: bash --noprofile --norc -euxo pipefail {0}
1514
working-directory: build
1615

17-
- name: Archive test artifacts on failure
18-
if: failure()
16+
- name: Set `TEST_ARTIFACT_NAME`
1917
run: |
20-
TAR_FILENAME=${{ matrix.image || matrix.os || github.job }}-${{ matrix.compiler }}.tar.gz
21-
TAR_FILENAME=$(echo "${TAR_FILENAME}" | sed 's/:/-/g')
22-
tar -zcf ${TAR_FILENAME} tests
18+
echo "TEST_ARTIFACT_NAME=$(echo ${{ matrix.image || matrix.os || matrix.box_generic || github.job }}-${{ matrix.build_system }}-${{ matrix.compiler }} | sed 's/[^0-9a-zA-Z-]/_/g')" >> ${GITHUB_ENV}
2319
shell: bash --noprofile --norc -euxo pipefail {0}
24-
working-directory: build
25-
26-
- name: Upload test artifacts on failure
2720
if: failure()
28-
uses: actions/upload-artifact@v3
21+
22+
- name: Upload `mod_tile` test artifacts on failure
23+
uses: actions/upload-artifact@v4
2924
with:
30-
name: Test Artifacts
31-
path: build/*.tar.gz
25+
name: Test Artifacts - ${{ env.TEST_ARTIFACT_NAME }}
26+
path: build/tests
27+
if: failure()
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
inputs:
3+
genhtml-extra-options:
4+
default: ""
5+
lcov-extra-options:
6+
default: ""
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Process `mod_tile` coverage results with CTest
12+
run: |
13+
ctest -T coverage || true
14+
shell: bash --noprofile --norc -euxo pipefail {0}
15+
working-directory: build
16+
if: matrix.build_system == 'CMake'
17+
18+
- name: Process `mod_tile` coverage results
19+
run: |
20+
lcov ${{ inputs.lcov-extra-options }} \
21+
--base-directory . \
22+
--capture \
23+
--directory ${{ matrix.build_system == 'CMake' && 'build' || '.' }} \
24+
--output-file coverage.info \
25+
--rc geninfo_unexecuted_blocks=1
26+
lcov ${{ inputs.lcov-extra-options }} \
27+
--ignore-errors unused \
28+
--output-file coverage.info \
29+
--remove coverage.info \
30+
"${GITHUB_WORKSPACE}/includes/*" \
31+
"${GITHUB_WORKSPACE}/tests/*" \
32+
"/usr/*"
33+
shell: bash --noprofile --norc -euxo pipefail {0}
34+
35+
- name: Report `mod_tile` coverage results to `codecov.io`
36+
uses: codecov/codecov-action@v3.1.5
37+
with:
38+
files: coverage.info
39+
40+
- name: Write `mod_tile` coverage summary to `$GITHUB_STEP_SUMMARY`
41+
run: |
42+
lcov ${{ inputs.lcov-extra-options }} \
43+
--summary \
44+
coverage.info | sed 's/^ /* /g' >> ${GITHUB_STEP_SUMMARY}
45+
shell: bash --noprofile --norc -euxo pipefail {0}
46+
47+
- name: Generate `mod_tile` coverage artifacts
48+
run: |
49+
genhtml ${{ inputs.genhtml-extra-options }} \
50+
--output-directory coverage \
51+
coverage.info
52+
shell: bash --noprofile --norc -euxo pipefail {0}
53+
54+
- name: Set `COVERAGE_ARTIFACT_NAME`
55+
run: |
56+
echo "COVERAGE_ARTIFACT_NAME=$(echo ${{ matrix.image || matrix.os || matrix.box_generic || github.job }}-${{ matrix.build_system }}-${{ matrix.compiler }} | sed 's/[^0-9a-zA-Z-]/_/g')" >> ${GITHUB_ENV}
57+
shell: bash --noprofile --norc -euxo pipefail {0}
58+
59+
- name: Upload `mod_tile` coverage artifacts
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: Coverage Artifacts - ${{ env.COVERAGE_ARTIFACT_NAME }}${{ matrix.mapnik_latest && ' (Latest Mapnik)' || '' }}
63+
path: |
64+
coverage
65+
coverage.info

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ runs:
1414

1515
- name: Cache "Download `Mapnik`" & "Build `Mapnik`"
1616
id: cache-mapnik-src
17-
uses: actions/cache@v3
17+
uses: actions/cache@v4
1818
with:
1919
path: mapnik-src
2020
key: ${{ matrix.image }}-${{ matrix.compiler }}-mapnik-${{ inputs.version }}

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ runs:
44
steps:
55
- name: Cache "Checkout `Mapnik`" & "Build `Mapnik`"
66
id: cache-mapnik
7-
uses: actions/cache@v3
7+
uses: actions/cache@v4
88
with:
99
path: |
1010
mapnik-build
1111
mapnik-src
12-
key: ${{ matrix.image }}-${{ matrix.compiler }}-mapnik-latest
12+
key: ${{ matrix.image || matrix.os || matrix.box_generic || github.job }}-${{ matrix.compiler }}-mapnik-latest
1313

1414
- name: Checkout `Mapnik`
1515
uses: actions/checkout@v4
@@ -23,14 +23,24 @@ 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 \
38+
-DCMAKE_CXX_STANDARD:STRING=17 \
2939
-DCMAKE_INSTALL_PREFIX:PATH=/usr
3040
cmake --build mapnik-build
3141
shell: bash --noprofile --norc -euxo pipefail {0}
3242
if: steps.cache-mapnik.outputs.cache-hit != 'true'
3343

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

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

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ inputs:
1313
default: >-
1414
cmake
1515
git
16-
libboost-filesystem-dev
1716
libboost-program-options-dev
1817
libboost-regex-dev
1918
libfreetype6-dev
@@ -32,6 +31,8 @@ inputs:
3231
default: >-
3332
apache2
3433
jq
34+
lcov
35+
memcached
3536
fedora-build-dependencies:
3637
default: >-
3738
cairo-devel
@@ -47,6 +48,9 @@ inputs:
4748
default: >-
4849
httpd
4950
jq
51+
lcov
52+
memcached
53+
procps
5054
freebsd-build-dependencies:
5155
default: >-
5256
apache24
@@ -61,6 +65,8 @@ inputs:
6165
freebsd-test-dependencies:
6266
default: >-
6367
jq
68+
lcov
69+
memcached
6470
macos-build-dependencies:
6571
default: >-
6672
apr
@@ -76,6 +82,8 @@ inputs:
7682
default: >-
7783
coreutils
7884
jq
85+
lcov
86+
memcached
7987
opensuse-build-dependencies:
8088
default: >-
8189
apache2-devel
@@ -92,6 +100,8 @@ inputs:
92100
apache2-event
93101
apache2-prefork
94102
jq
103+
lcov
104+
memcached
95105
opensuse-mapnik-build-dependencies:
96106
default: >-
97107
bzip2
@@ -129,6 +139,9 @@ inputs:
129139
default: >-
130140
httpd
131141
jq
142+
lcov
143+
memcached
144+
procps
132145
rhel-mapnik-build-dependencies:
133146
default: >-
134147
boost-devel
@@ -162,7 +175,6 @@ inputs:
162175
default: >-
163176
cmake
164177
git
165-
libboost-filesystem-dev
166178
libboost-program-options-dev
167179
libboost-regex-dev
168180
libfreetype6-dev
@@ -181,31 +193,28 @@ inputs:
181193
default: >-
182194
apache2
183195
jq
196+
lcov
197+
memcached
184198
mapnik-build-version-centos-stream:
185199
default: 3.1.0
186-
mapnik-build-version-amazonlinux2-centos7:
187-
default: 3.0.17
188200
mapnik-build-version-opensuse:
189201
default: 3.1.0
190202

191203
runs:
192204
using: composite
193205
steps:
194-
- name: Install Dependencies (Amazon Linux/CentOS/CentOS Stream)
206+
- name: Install Dependencies (CentOS Stream)
195207
uses: ./.github/actions/dependencies/install/yum
196208
with:
197209
dependencies: epel-release
198210
packages: >-
199211
${{ inputs.rhel-build-dependencies }}
200212
${{ inputs.rhel-mapnik-build-dependencies }}
201213
${{ inputs.rhel-test-dependencies }}
202-
${{ matrix.build_system == 'CMake' && 'cmake3' || 'autoconf automake redhat-rpm-config' }}
214+
${{ matrix.build_system == 'CMake' && 'cmake' || 'autoconf automake redhat-rpm-config' }}
203215
${{ matrix.compiler == 'LLVM' && 'clang' || 'gcc gcc-c++' }}
204-
${{ matrix.image == 'centos:7' && matrix.compiler == 'LLVM' && 'gcc-c++' || '' }}
205-
if: |
206-
startsWith(matrix.image, 'amazonlinux:') ||
207-
startsWith(matrix.image, 'centos:') ||
208-
startsWith(matrix.image, 'quay.io/centos/centos:stream')
216+
rpm-build
217+
if: startsWith(matrix.image, 'quay.io/centos/centos:stream')
209218

210219
- name: Install Dependencies (Debian)
211220
uses: ./.github/actions/dependencies/install/apt-get
@@ -226,6 +235,7 @@ runs:
226235
${{ inputs.fedora-test-dependencies }}
227236
${{ matrix.build_system == 'CMake' && 'cmake' || 'autoconf automake redhat-rpm-config' }}
228237
${{ matrix.compiler == 'LLVM' && 'clang' || 'gcc gcc-c++' }}
238+
rpm-build
229239
if: startsWith(matrix.image, 'fedora:')
230240

231241
- name: Install Dependencies (FreeBSD)
@@ -257,6 +267,7 @@ runs:
257267
${{ inputs.opensuse-test-dependencies }}
258268
${{ matrix.build_system == 'CMake' && 'cmake' || 'automake' }}
259269
${{ matrix.compiler == 'LLVM' && 'clang' || 'gcc12 gcc12-c++' }}
270+
rpm-build
260271
if: startsWith(matrix.image, 'opensuse/')
261272

262273
- name: Install Dependencies (Ubuntu)
@@ -285,12 +296,6 @@ runs:
285296
shell: bash --noprofile --norc -euxo pipefail {0}
286297
if: startsWith(matrix.image, 'opensuse/')
287298

288-
- name: Build & Install `mapnik` (Amazon Linux 2/CentOS 7)
289-
uses: ./.github/actions/dependencies/build-and-install/mapnik
290-
with:
291-
version: ${{ inputs.mapnik-build-version-amazonlinux2-centos7 }}
292-
if: matrix.image == 'amazonlinux:2' || matrix.image == 'centos:7'
293-
294299
- name: Build & Install `mapnik` (CentOS Stream)
295300
uses: ./.github/actions/dependencies/build-and-install/mapnik
296301
with:
@@ -307,7 +312,7 @@ runs:
307312
uses: ./.github/actions/dependencies/build-and-install/mapnik/latest
308313
if: |
309314
matrix.mapnik_latest &&
310-
(startsWith(matrix.image, 'debian:') || startsWith(matrix.image, 'ubuntu:'))
315+
(startsWith(matrix.image, 'debian:') || startsWith(matrix.image, 'ubuntu:') || runner.os == 'Linux')
311316
312317
- name: Build & Install latest `mapnik` (openSUSE)
313318
uses: ./.github/actions/dependencies/build-and-install/mapnik/latest

0 commit comments

Comments
 (0)