diff --git a/.travis.yml b/.travis.yml index 1fda9f2..e1a45b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,25 +22,25 @@ env: init: /sbin/init run_opts: "" SITE: package - PHP_VERSION: 5.3 + PHP_VERSION: 5.6 - distribution: centos version: 7 init: /usr/lib/systemd/systemd run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" SITE: package - PHP_VERSION: 5.4 + PHP_VERSION: 5.6 - distribution: ubuntu version: 14.04 init: /sbin/init run_opts: "" SITE: package - PHP_VERSION: 5.5 + PHP_VERSION: 5.6 - distribution: ubuntu version: 12.04 init: /sbin/init run_opts: "" SITE: package - PHP_VERSION: 5.3 + PHP_VERSION: 5.6 services: - docker @@ -57,6 +57,9 @@ script: # Run container in detached state - 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"' + # Install dependencies. + - 'sudo docker exec "$(cat ${container_id})" ansible-galaxy install -r /etc/ansible/roles/role_under_test/tests/requirements.yml' + # Ansible syntax check. - 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test-${SITE}.yml --syntax-check' diff --git a/tests/requirements.yml b/tests/requirements.yml new file mode 100644 index 0000000..711227a --- /dev/null +++ b/tests/requirements.yml @@ -0,0 +1,2 @@ +--- +- src: geerlingguy.repo-remi diff --git a/tests/test-package.yml b/tests/test-package.yml index f949d2d..71369a6 100644 --- a/tests/test-package.yml +++ b/tests/test-package.yml @@ -3,11 +3,18 @@ vars: php_enable_webserver: false + php_version: 5.6 + php_enablerepo: "remi,remi-php56" pre_tasks: - name: Ensure build dependencies are installed (RedHat). yum: name=which state=present when: ansible_os_family == 'RedHat' + - name: Add repository for PHP 5.6. + apt_repository: repo='ppa:ondrej/php5-5.6' + when: ansible_os_family == 'Debian' + roles: + - { role: geerlingguy.repo-remi, when: ansible_os_family == 'RedHat' } - role_under_test