ansible-role-php/.travis.yml

75 lines
2.4 KiB
YAML
Raw Normal View History

2014-04-23 18:29:49 +02:00
---
services: docker
2014-04-23 18:29:49 +02:00
env:
2016-02-16 17:25:40 +01:00
# Test package install on all supported OSes.
- distro: centos7
2016-09-14 23:22:10 +02:00
playbook: test.yml
php_version: 7.0
- distro: fedora27
playbook: test.yml
2018-02-18 18:24:52 +01:00
php_version: 7.1
- distro: debian9
playbook: test.yml
php_version: 7.0
2017-05-15 06:10:58 +02:00
- distro: debian8
playbook: test.yml
php_version: 7.0
- distro: ubuntu1804
playbook: test.yml
2018-04-26 20:10:32 +02:00
php_version: 7.0
- distro: ubuntu1604
playbook: test.yml
php_version: 7.0
- distro: ubuntu1404
playbook: test.yml
php_version: 7.0
2016-09-14 23:22:10 +02:00
# Only test source install on latest supported OSes.
- distro: centos7
playbook: test-source.yml
php_version: 7.1.17
- distro: ubuntu1804
2016-09-14 23:22:10 +02:00
playbook: test-source.yml
php_version: 7.1.17
2016-09-14 23:22:10 +02:00
2014-04-23 18:29:49 +02:00
script:
# Configure test script so we can run extra tests after playbook is run.
- export container_id=$(date +%s)
- export cleanup=false
2014-04-23 18:29:49 +02:00
# Download test shim.
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/
- chmod +x ${PWD}/tests/test.sh
2016-02-16 17:25:40 +01:00
# Run tests.
- ${PWD}/tests/test.sh
2014-04-23 18:29:49 +02:00
2016-02-16 17:25:40 +01:00
# Ensure PHP is installed and at the right version.
- 'docker exec --tty ${container_id} env TERM=xterm which php'
- 'docker exec --tty ${container_id} env TERM=xterm test -x /usr/bin/php'
2015-05-26 17:32:11 +02:00
- 'docker exec --tty ${container_id} env TERM=xterm php --version'
- 'docker exec --tty ${container_id} env TERM=xterm /usr/bin/php --version | grep -qF "PHP ${php_version}"'
2015-06-01 04:05:08 +02:00
# Ensure PHP configurations have taken effect.
- docker exec --tty ${container_id} env TERM=xterm php -i | grep 'memory_limit.*192'
2016-02-08 21:09:43 +01:00
# Check the status of PHP-FPM.
- |
if [ "${playbook}" == "test.yml" ]; then
case "${distro}" in
"centos7"|"fedora24")
docker exec --tty ${container_id} env TERM=xterm systemctl --no-pager status php-fpm status
docker exec --tty ${container_id} env TERM=xterm systemctl --no-pager status php-fpm status | grep -qF "fpm.service; enabled"
;;
2018-04-26 20:10:32 +02:00
"debian8"|"ubuntu1604"|"ubuntu1804")
docker exec --tty ${container_id} env TERM=xterm systemctl --no-pager status php${php_version}-fpm status
docker exec --tty ${container_id} env TERM=xterm systemctl --no-pager status php${php_version}-fpm status | grep -qF "fpm.service; enabled"
;;
esac
fi
2017-05-15 06:10:58 +02:00
2016-02-08 21:09:43 +01:00
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/