-
Notifications
You must be signed in to change notification settings - Fork 23
/
.travis.yml
132 lines (113 loc) · 4.87 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
130
131
132
dist: focal
language: perl
perl: "5.38"
stages:
- test
script:
- perl Makefile.PL && make test TEST_VERBOSE=1
jobs:
include:
- stage: test
env: TARGET=SQLite ZONEMASTER_TRAVIS_TESTING=1 ZONEMASTER_RECORD=0 ZONEMASTER_BACKEND_CONFIG_FILE=./share/travis_sqlite_backend_config.ini
- env: TARGET=MySQL ZONEMASTER_TRAVIS_TESTING=1 ZONEMASTER_RECORD=0 ZONEMASTER_BACKEND_CONFIG_FILE=./share/travis_mysql_backend_config.ini
services: mysql
- env: TARGET=PostgreSQL ZONEMASTER_TRAVIS_TESTING=1 ZONEMASTER_RECORD=0 ZONEMASTER_BACKEND_CONFIG_FILE=./share/travis_postgresql_backend_config.ini
dist: jammy
services: postgresql
# Cover supported Perl versions with SQLite
- perl: "5.34"
env: TARGET=SQLite ZONEMASTER_TRAVIS_TESTING=1 ZONEMASTER_RECORD=0 ZONEMASTER_BACKEND_CONFIG_FILE=./share/travis_sqlite_backend_config.ini
- perl: "5.26"
env: TARGET=SQLite ZONEMASTER_TRAVIS_TESTING=1 ZONEMASTER_RECORD=0 ZONEMASTER_BACKEND_CONFIG_FILE=./share/travis_sqlite_backend_config.ini
addons:
apt:
packages:
# From Zonemaster Engine installation instruction
- autoconf
- automake
- build-essential
- cpanminus
- libclone-perl
- libextutils-pkgconfig-perl
- libfile-sharedir-perl
- libfile-slurp-perl
- libidn2-dev
- libintl-perl
- libio-socket-inet6-perl
- libjson-pp-perl
- liblist-compare-perl
- liblist-moreutils-perl
- liblocale-msgfmt-perl
- libmail-rfc822-address-perl
- libmail-spf-perl
- libmodule-find-perl
- libnet-ip-xs-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
- libio-stringy-perl
- libjson-pp-perl
- libjson-rpc-perl
- liblog-any-adapter-dispatch-perl
- liblog-any-perl
- liblog-dispatch-perl
- libplack-middleware-debug-perl
- libplack-perl
- librole-tiny-perl
- librouter-simple-perl
- libtest-nowarnings-perl
- libtry-tiny-perl
- postgresql
- starman
before_install:
# Help Perl find modules installed from OS packages
- export PERL5LIB=/usr/share/perl5
# Provide cpanm helper
# quoting preserves newlines in the script and then avoid error when
# the script contains comments
- 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
# Install share files
- mkdir -p ./lib/auto/share/dist/
- ln -s ../../../../share ./lib/auto/share/dist/Zonemaster-Backend
# Change default PostgreSQL 14 port to 5432
- if [[ "$TARGET" == "PostgreSQL" ]]; then sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/14/main/postgresql.conf; fi
- if [[ "$TARGET" == "PostgreSQL" ]]; then sudo pg_ctlcluster 14 main restart; fi
before_script:
- if [[ "$TARGET" == "PostgreSQL" ]]; then psql -U travis -c "CREATE USER travis_zonemaster WITH PASSWORD 'travis_zonemaster';"; fi
- if [[ "$TARGET" == "PostgreSQL" ]]; then psql -U travis -c 'CREATE DATABASE travis_zonemaster OWNER travis_zonemaster;'; fi
- if [[ "$TARGET" == "PostgreSQL" ]]; then cpanm DBD::Pg; fi
- if [[ "$TARGET" == "MySQL" ]]; then mysql -u root -e "CREATE USER 'travis_zm'@'localhost' IDENTIFIED BY 'travis_zonemaster';"; fi
- if [[ "$TARGET" == "MySQL" ]]; then mysql -u root -e "CREATE DATABASE travis_zonemaster CHARACTER SET utf8 COLLATE utf8_bin;"; fi
- if [[ "$TARGET" == "MySQL" ]]; then mysql -u root -e "GRANT ALL ON travis_zonemaster.* TO 'travis_zm'@'localhost';"; fi
- if [[ "$TARGET" == "MySQL" ]]; then cpanm DBD::mysql; fi