-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
97 lines (83 loc) · 3.54 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
dist: jammy
sudo: required
branches:
only:
- master
- develop
language: php
services:
- postgresql
php:
# Test oldest and newest maintained versions.
- '8.1'
- '8.2'
env:
# Test oldest and newest maintained versions.
- PGVERSION=14
addons:
apt:
packages:
- postgresql-14-postgis-3
env:
global:
- PGPORT=5432
- PGUSER=postgres
before_install:
# Output info for debugging.
- php -r "echo phpinfo();"
# Update the package list.
- sudo apt-get update
# Install Apache.
# From https://docs.travis-ci.com/user/languages/php
# Currently Travis CI does not support mod_php for apache, but you can
# configure php-fpm for your integration tests.
- sudo apt-get install apache2
# Install mod_fastcgi which is no longer available in Ubuntu repositories.
- wget http://mirrors.kernel.org/ubuntu/pool/multiverse/liba/libapache-mod-fastcgi/libapache2-mod-fastcgi_2.4.7~0910052141-1.2_amd64.deb
- sudo dpkg -i libapache2-mod-fastcgi_2.4.7~0910052141-1.2_amd64.deb
# enable php-fpm
- sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/fastcgi
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# configure apache virtual hosts
- sudo cp -f .travis/travis-ci-apache /etc/apache2/sites-available/000-default.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
- sudo service apache2 restart
install:
# Install dependencies.
- composer install
# Includes a version of DbUnit that is being kept compatible with PHPUnit.
# The original DbUnit has been abandonned. https://github.com/sebastianbergmann/dbunit
# Grant execute on scripts
- chmod +x .travis/postgres_setup.sh
before_script:
- psql --version
- pg_lsclusters
# Create database
- psql -d postgres -c 'create database indicia;' -U ${PGUSER} -p ${PGPORT}
# Add extension for PostGIS
- psql -d indicia -c "create extension postgis" -U ${PGUSER} -p ${PGPORT}
- psql -d indicia -c "create extension postgis_topology" -U ${PGUSER} -p ${PGPORT}
# Add extension for btree_gin indexes.
- psql -d indicia -c "create extension btree_gin" -U ${PGUSER} -p ${PGPORT}
# Add extension for hstore and the audit trail.
- psql -d indicia -c "create extension hstore" -U ${PGUSER} -p ${PGPORT}
# Set up database.
- .travis/postgres_setup.sh
# Enable the phpunit module in config.php (meaning initialise() is not tested)
- cp application/config/config.php.travis application/config/config.php
# Provide a config file for the rest_api, spatial_index_builder and request_logging modules
- cp modules/rest_api/config/rest.php.travis modules/rest_api/config/rest.php
- cp modules/spatial_index_builder/config/spatial_index_builder.php.travis modules/spatial_index_builder/config/spatial_index_builder.php
- cp modules/request_logging/config/request_logging.example.php modules/request_logging/config/request_logging.php
script:
- vendor/phpunit/phpunit/phpunit --stderr --configuration phpunit-config-test.xml
- vendor/phpunit/phpunit/phpunit --stderr --configuration phpunit-setup-check-test.xml
- vendor/phpunit/phpunit/phpunit --stderr --configuration phpunit-home-test.xml
# Repeat to upgrade modules
- vendor/phpunit/phpunit/phpunit --stderr --configuration phpunit-home-test.xml
- vendor/phpunit/phpunit/phpunit --stderr --configuration phpunit-tests.xml
after_script:
- cat application/logs/*