forked from gravitystorm/openstreetmap-carto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
45 lines (45 loc) · 1.74 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
language: node_js
dist: bionic
sudo: false
node_js:
- "10"
services:
- postgresql
addons:
postgresql: "9.5"
apt:
packages:
- lua5.1
- libxml2-utils
- python3-pip
- python3-setuptools
- python-yaml
- postgresql-9.5-postgis-2.4
- osm2pgsql
env:
- CARTO=1.2.0 MAPNIK='3.0.0 3.0.12'
install:
- npm install carto@$CARTO
- pip3 install --user colormath
- createdb -w -E utf8 -U postgres gis && psql -Xq -d gis -U postgres -w -c "CREATE EXTENSION postgis; CREATE EXTENSION hstore;"
script:
# We're using pipes in the checks, so fail if any part fails
- set -o pipefail
# Check all tye YAML files are valid YAML
- find . -not \( -path ./node_modules -prune \) \( -type f -name '*.yaml' -o -name '*.yml' -o -name '*.mml' \)
-exec python -c "from yaml import safe_load; safe_load(file('{}'))" \;
# Validate the MML against multiple Mapnik versions, and report its lines for debugging purposes
- for m in $MAPNIK; do ./node_modules/carto/bin/carto -a $m project.mml | xmllint - | wc -l; done
# Validate that the SVGs are valid XML
- find symbols/ -name '*.svg' | xargs xmllint --noout
# Check the Lua transforms
- lua scripts/lua/test.lua
# Check the indexes and road colours files are up to date
- diff -qu <(scripts/indexes.py) indexes.sql
- diff -qu <(scripts/generate_road_colours.py) style/road-colors-generated.mss
# Create the PostgreSQL tables
- osm2pgsql -G --hstore --style openstreetmap-carto.style --tag-transform-script openstreetmap-carto.lua -U postgres -d gis -r xml <(echo '<osm version="0.6"/>')
# Apply the custom indexes
- psql -1Xq -v ON_ERROR_STOP=1 -d gis -f indexes.sql
# Test for classes in project.mml (not supported in vector tiles)
- '! grep "class:" project.mml > /dev/null'