Skip to content

Commit 68e46a2

Browse files
authored
Added test for installing from distribution packages (#330)
In order to ensure that the instructions contained within `README.rst` also work when installing `mod_tile` packages from `Debian`/`Ubuntu` repositories, I have added a basic test which first installs those packages and then executes the same commands from the aforementioned instructions. Here is an example of a workflow run: https://github.com/hummeltech/mod_tile/actions/runs/5638547864 **Also:** * Add additional image format types into example configuration instructions in `README.rst` * Which are already referenced in [utils/example-map/index.html](https://github.com/openstreetmap/mod_tile/blob/master/utils/example-map/index.html#L28-L39) * Add step in `README.rst` to ensure `/var/run/renderd` exists
1 parent 030c353 commit 68e46a2

2 files changed

Lines changed: 106 additions & 2 deletions

File tree

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
name: Install Package & Test
3+
4+
on:
5+
- push
6+
7+
jobs:
8+
install-package-and-test:
9+
name: ${{ matrix.image }}
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
image:
14+
- "debian:11"
15+
- "debian:12"
16+
- "ubuntu:22.04"
17+
fail-fast: false
18+
container:
19+
image: ${{ matrix.image }}
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Install mod_tile & renderd
25+
uses: ./.github/actions/dependencies/install/apt-get
26+
with:
27+
packages: >-
28+
apache2
29+
curl
30+
libapache2-mod-tile
31+
renderd
32+
33+
- name: Prepare
34+
run: |
35+
mkdir -p /usr/share/renderd
36+
cp -av utils/example-map /usr/share/renderd/
37+
cp -av etc/apache2/renderd-example-map.conf /etc/apache2/sites-available/renderd-example-map.conf
38+
printf '
39+
[example-map]
40+
URI=/tiles/renderd-example
41+
XML=/usr/share/renderd/example-map/mapnik.xml
42+
43+
[example-map-jpg]
44+
TYPE=jpg image/jpeg jpeg
45+
URI=/tiles/renderd-example-jpg
46+
XML=/usr/share/renderd/example-map/mapnik.xml
47+
48+
[example-map-png256]
49+
TYPE=png image/png png256
50+
URI=/tiles/renderd-example-png256
51+
XML=/usr/share/renderd/example-map/mapnik.xml
52+
53+
[example-map-png32]
54+
TYPE=png image/png png32
55+
URI=/tiles/renderd-example-png32
56+
XML=/usr/share/renderd/example-map/mapnik.xml
57+
58+
[example-map-webp]
59+
TYPE=webp image/webp webp
60+
URI=/tiles/renderd-example-webp
61+
XML=/usr/share/renderd/example-map/mapnik.xml
62+
' | tee -a /etc/renderd.conf
63+
mkdir -p /var/run/renderd
64+
renderd
65+
a2enmod tile
66+
a2ensite renderd-example-map
67+
apache2ctl restart
68+
shell: bash --noprofile --norc -euxo pipefail {0}
69+
70+
- name: Test
71+
run: |
72+
until $(curl --fail --output tile.png --silent http://localhost:8081/tiles/renderd-example/9/297/191.png); do
73+
echo 'Sleeping 5s';
74+
sleep 5;
75+
done
76+
echo 'dbf26531286e844a3a9735cdd193598dca78d22f77cafe5824bcaf17f88cbb08 tile.png' | sha256sum --check
77+
shell: bash --noprofile --norc -euxo pipefail {0}
78+
timeout-minutes: 1

README.rst

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,43 @@ Copy the apache configuration file to its place, too:
9898

9999
$ sudo cp -av etc/apache2/renderd-example-map.conf /etc/apache2/sites-available/renderd-example-map.conf
100100

101-
Add a map configuration for example-map to ``/etc/renderd.conf`:
101+
Add map configurations for example-map to ``/etc/renderd.conf``:
102102

103103
::
104104

105105
$ printf '
106106
[example-map]
107107
URI=/tiles/renderd-example
108108
XML=/usr/share/renderd/example-map/mapnik.xml
109+
110+
[example-map-jpg]
111+
TYPE=jpg image/jpeg jpeg
112+
URI=/tiles/renderd-example-jpg
113+
XML=/usr/share/renderd/example-map/mapnik.xml
114+
115+
[example-map-png256]
116+
TYPE=png image/png png256
117+
URI=/tiles/renderd-example-png256
118+
XML=/usr/share/renderd/example-map/mapnik.xml
119+
120+
[example-map-png32]
121+
TYPE=png image/png png32
122+
URI=/tiles/renderd-example-png32
123+
XML=/usr/share/renderd/example-map/mapnik.xml
124+
125+
[example-map-webp]
126+
TYPE=webp image/webp webp
127+
URI=/tiles/renderd-example-webp
128+
XML=/usr/share/renderd/example-map/mapnik.xml
109129
' | sudo tee -a /etc/renderd.conf
110130

111-
Start the rendering daemon
131+
Ensure the ``/var/run/renderd`` directory exists:
132+
133+
::
134+
135+
$ sudo mkdir -p /var/run/renderd
136+
137+
Start the rendering daemon:
112138

113139
::
114140

0 commit comments

Comments
 (0)