forked from zonemaster/zonemaster-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
116 lines (100 loc) · 4.21 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
services:
- mysql
- postgresql
env:
- TARGET=MySQL ZONEMASTER_RECORD=0 ZONEMASTER_BACKEND_CONFIG_FILE=./share/travis_mysql_backend_config.ini
- TARGET=PostgreSQL ZONEMASTER_RECORD=0 ZONEMASTER_BACKEND_CONFIG_FILE=./share/travis_postgresql_backend_config.ini
- TARGET=SQLite ZONEMASTER_RECORD=0 ZONEMASTER_BACKEND_CONFIG_FILE=./share/travis_sqlite_backend_config.ini
language: perl
perl:
- "5.30"
- "5.28"
- "5.26"
- "5.24"
- "5.22"
# Perl 5.16 is temporarily excluded because Travis fails
addons:
apt:
packages:
# From Zonemaster Engine installation instruction
- autoconf
- automake
- build-essential
- cpanminus
- libclone-perl
- libfile-sharedir-perl
- libfile-slurp-perl
- libidn11-dev
- libintl-perl
- libio-socket-inet6-perl
- libjson-pp-perl
- liblist-moreutils-perl
- liblocale-msgfmt-perl
- libmail-rfc822-address-perl
- libmodule-find-perl
- libnet-ip-perl
- libpod-coverage-perl
- libreadonly-perl
- libreadonly-xs-perl
- libssl-dev
- libtest-differences-perl
- libtest-exception-perl
- libtest-fatal-perl
- libtest-pod-perl
- libtext-csv-perl
- libtool
- m4
# From Zonemaster Backend installation instruction
- libclass-method-modifiers-perl
- libconfig-inifiles-perl
- libdbd-sqlite3-perl
- libdbi-perl
- libfile-sharedir-perl
- libfile-slurp-perl
- libhtml-parser-perl
- libio-captureoutput-perl
- libjson-pp-perl
- libjson-rpc-perl
- liblog-any-adapter-dispatch-perl
- liblog-any-perl
- liblog-dispatch-perl
- libplack-perl
- libplack-middleware-debug-perl
- librole-tiny-perl
- librouter-simple-perl
- libstring-shellquote-perl
- starman
before_install:
# Help Perl find modules installed from OS packages
- export PERL5LIB=/usr/share/perl5
# Provide cpanm helper
- eval $(curl https://travis-perl.github.io/init) --auto
# Zonemaster LDNS needs a newer version of Module::Install
- cpan-install Module::Install Module::Install::XSUtil
# Zonemaster Backend transitively needs a newer version of Devel::CheckLib
- cpan-install Devel::CheckLib
# Moose installed from OS packages depend on a newer version of Devel::OverloadInfo
- cpan-install Devel::OverloadInfo Moose
# IO::Socket::INET6 can't find Socket6 unless it's installed from CPAN
- cpan-install Socket6
# Install Zonemaster LDNS
- git clone --depth=1 --branch=$TRAVIS_BRANCH https://github.com/zonemaster/zonemaster-ldns.git
- ( cd zonemaster-ldns && cpanm --verbose --notest --configure-args="--no-ed25519" . ) && rm -rf zonemaster-ldns
# Install Zonemaster Engine
- git clone --depth=1 --branch=$TRAVIS_BRANCH https://github.com/zonemaster/zonemaster-engine.git
- ( cd zonemaster-engine && cpanm --verbose --notest . ) && rm -rf zonemaster-engine
before_script:
- if [[ "$TARGET" == "PostgreSQL" ]]; then psql -c "create user travis_zonemaster WITH PASSWORD 'travis_zonemaster';" -U postgres; fi
- if [[ "$TARGET" == "PostgreSQL" ]]; then psql -c 'create database travis_zonemaster OWNER travis_zonemaster;' -U postgres; fi
- if [[ "$TARGET" == "PostgreSQL" ]]; then cpanm DBD::Pg; fi
- if [[ "$TARGET" == "PostgreSQL" ]]; then perl -I./lib ./script/create_db_postgresql_9.3.pl; fi
- if [[ "$TARGET" == "MySQL" ]]; then mysql -e "CREATE USER 'travis_zm'@'localhost' IDENTIFIED BY 'travis_zonemaster';" -u root; fi
- if [[ "$TARGET" == "MySQL" ]]; then mysql -e "CREATE DATABASE travis_zonemaster CHARACTER SET utf8 COLLATE utf8_bin;" -u root; fi
- if [[ "$TARGET" == "MySQL" ]]; then mysql -e "GRANT ALL ON travis_zonemaster.* TO 'travis_zm'@'localhost';" -u root; fi
- if [[ "$TARGET" == "MySQL" ]]; then mysql -e "FLUSH PRIVILEGES;" -u root; fi
- if [[ "$TARGET" == "MySQL" ]]; then cpanm --force DBD::mysql; fi
- if [[ "$TARGET" == "MySQL" ]]; then perl -I./lib ./script/create_db_mysql.pl; fi
script:
- if [[ "$TARGET" == "SQLite" ]]; then perl Makefile.PL && make test; fi
- if [[ "$TARGET" == "PostgreSQL" ]]; then perl -I./lib ./t/test_DB_backend.pl PostgreSQL; fi
- if [[ "$TARGET" == "MySQL" ]]; then perl -I./lib ./t/test_DB_backend.pl MySQL; fi