forked from openxpki/openxpki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
95 lines (87 loc) · 3.03 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
# We use our own Perl setup (language "generic" uses a stripped-down TravisCI image)
language: generic
virt: lxd
# TravisCI does not support lxd (containers) with amd64
arch: arm64
os: linux
# Ubuntu 18.04 "Bionic" (Debian Buster equivalent)
dist: bionic
env:
global:
# assume the Git submodule is cloned into config/ according to .gitmodules
- OXI_TEST_SAMPLECONFIG_DIR=$TRAVIS_BUILD_DIR/config
- OXI_TEST_DB_MYSQL_NAME=openxpki
- OXI_TEST_DB_MYSQL_USER=openxpki
- OXI_TEST_DB_MYSQL_PASSWORD=openxpki
- OXI_TEST_DB_MYSQL_DBUSER=root
- OXI_TEST_DB_MYSQL_DBPASSWORD=
jobs:
- OXI_TEST_RUN=unit_coverage
- OXI_TEST_RUN=api2
- OXI_TEST_RUN=webui
- OXI_TEST_RUN=client
cache:
directories:
- $HOME/perl5/lib/perl5
before_cache:
- |
while read -d : path; do
test $path == "." && continue;
echo "Purging $path/OpenXPKI*";
rm -rf $path/OpenXPKI*;
rm -rf $path/auto/OpenXPKI*;
done <<< $(perl -e 'print "$_:" for @INC')
# - rm -Rf $HOME/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/OpenXPKI
#
# OS packages
#
addons:
apt:
packages:
- openssl
- libssl-dev
- pkg-config
- cpanminus
- figlet
# mariadb: '10.1'
# ... doesn't work, throws apt error messages because it conflicts with MySQL
#
# Service setup
#
before_install:
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xf1656f24c74cd1d8
- sudo apt-get -q update
- sudo apt-get -y purge mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7
# we need to prevent invoke-rc.d from starting MariaDB as this would make
# the TravisCI LXD container hang forever. So we pretend it's runlevel 1
# where most services aren't started: (https://askubuntu.com/a/221938)
- sudo echo -e '#!/bin/sh\nexit 101' | sudo install -m 755 /dev/stdin /usr/sbin/policy-rc.d && sudo apt-get -y install mariadb-server-10.1 libmariadbclient-dev && sudo rm -f /usr/sbin/policy-rc.d
# now start MariaDB in background
- sudo /usr/bin/mysqld_safe 2>&1 >/dev/null &
# create database
- sudo ./tools/testenv/mysql-wait-for-db.sh
- sudo ./tools/testenv/mysql-create-db.sh
- sudo ./tools/testenv/mysql-create-user.sh
- sudo ./tools/testenv/mysql-create-schema.sh
# setup cpanm
- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
#
# Dependencies / modules
#
install:
- cpanm --quiet --notest PPI
- ./tools/scripts/makefile2cpanfile.pl > ./cpanfile
- cpanm --quiet --notest --installdeps ./
# We need to reinstall Devel::Cover because we told TravisCI to cache
# ~/perl5/lib/perl5 but not ~/perl5/bin - so on next run the "cover"
# script will be gone
- cpanm --quiet --notest --reinstall Devel::Cover
- cpanm --quiet --notest Devel::Cover::Report::Coveralls
#
# Build
#
# (must be specified if "language" is "generic")
script:
- which perl
- perl -v
- ./tools/scripts/travis-install-and-test.sh