forked from repology/repology-updater
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
129 lines (119 loc) · 3.9 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
language: python
sudo: true
addons:
postgresql: "10"
apt:
packages:
- postgresql-10
- postgresql-client-10
- postgresql-server-dev-10
#- python3-rpm # missing on Trusty
env:
global:
- PGPORT=5433
- REPOLOGY_CONFIG=repology-test.conf.default
cache:
pip: true
directories:
- dep-libversion
- dep-tidy-html5
- dep-postgresql-libversion
python:
- 3.6
before_install:
# install dependencies
# normally, these are installed from the package manager, but travis uses rotten ubuntu version
# XXX: building rpm4 is not possible as python3.6 installation in travis is incomplete (no libraries)
# So instead, we use this hack:
- touch rpm.py
#- |-
# mkdir -p dep-rpm
# (
# cd dep-rpm &&
# if [ -z "$(ls -A dep-rpm)" ]; then
# wget -qO- http://ftp.rpm.org/releases/rpm-4.14.x/rpm-4.14.1.tar.bz2 | tar -x -j -f- --strip-components 1 &&
# env PYTHON_CFLAGS="$(python-config --cflags)" PYTHON_LIBS="$(python-config --libs)" ./configure --enable-python --without-lua &&
# make
# fi &&
# sudo make install
# )
- |-
mkdir -p dep-libversion
(
cd dep-libversion &&
if [ -z "$(ls -A)" ]; then
wget -qO- https://github.com/repology/libversion/archive/master.tar.gz | tar -x -z -f- --strip-components 1 &&
cmake . &&
make
fi &&
sudo make install &&
sudo ldconfig
)
- |-
mkdir -p dep-html5-tidy
(
cd dep-html5-tidy &&
if [ -z "$(ls -A)" ]; then
wget -qO- https://github.com/htacg/tidy-html5/archive/master.tar.gz | tar -x -z -f- --strip-components 1 &&
cmake . &&
make
fi &&
sudo make install &&
sudo ldconfig
)
- |-
mkdir -p dep-postgresql-libversion
(
cd dep-postgresql-libversion &&
if [ -z "$(ls -A)" ]; then
wget -qO- https://github.com/repology/postgresql-libversion/archive/master.tar.gz | tar -x -z -f- --strip-components 1 &&
make
fi &&
sudo make install
)
# install mandatory python dependencies
- pip install Jinja2
- pip install PyYAML
- pip install flask
- pip install libversion
- pip install lxml
- pip install pillow
- pip install psycopg2
- pip install pytz
- pip install requests
- pip install rubymarshal
# install extra python dependencies
- pip install coveralls
- pip install flake8
- pip install flake8-builtins!=1.1.0
- pip install flake8-import-order
- pip install flake8-quotes
- pip install pytidylib # uses newer libtidy installed above
- pip install voluptuous
# get rules
- git clone --depth=1 https://github.com/repology/repology-rules.git rules.d
before_script:
- sudo -u postgres psql -c "CREATE DATABASE repology_test;"
- sudo -u postgres psql -c "CREATE USER repology_test WITH PASSWORD 'repology_test'"
- sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE repology_test TO repology_test"
- sudo -u postgres psql -d repology_test -c "CREATE EXTENSION IF NOT EXISTS pg_trgm"
- sudo -u postgres psql -d repology_test -c "CREATE EXTENSION IF NOT EXISTS libversion"
- echo "BADGE_FONT = '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf'" >> repology-test.conf.default
- sed -i -e 's|dbname=repology_test|& port=5433 host=localhost|' repology-test.conf.default
script:
# test all target
- make
# check yaml schemas
- make check
# check python syntax
- make flake8
# fill database with test data
- ./repology-update.py --initdb --parse --database --postupdate
# smoke test bits
- ./repology-dump.py --help
- ./repology-gensitemap.py --main > sitemap-main.xml
- ./repology-gensitemap.py --metapackages > sitemap-metapackages.xml
# run unit tests with coverage
- coverage run --source="repology,repologyapp" --omit="repology/fetchers/*" -m unittest discover
after_success:
- coveralls