]> git.immae.eu Git - github/fretlink/ansible-postgresql-role.git/blob - .travis.yml
tests: remove automatic tests with PG 9.5 & 9.6
[github/fretlink/ansible-postgresql-role.git] / .travis.yml
1 ---
2 dist: bionic
3 language: python
4 python: "3.8"
5
6 # Test on all supported PG versions on both debian stretch and debian buster
7 env:
8 - POSTGRESQL_VERSION=10 DEBIAN_RELEASE=stretch
9 - POSTGRESQL_VERSION=11 DEBIAN_RELEASE=stretch
10 - POSTGRESQL_VERSION=12 DEBIAN_RELEASE=stretch
11 - POSTGRESQL_VERSION=10 DEBIAN_RELEASE=buster
12 - POSTGRESQL_VERSION=11 DEBIAN_RELEASE=buster
13 - POSTGRESQL_VERSION=12 DEBIAN_RELEASE=buster
14
15 # Install pip
16 addons:
17 apt:
18 packages:
19 - python-pip
20
21 # Tests are using docker to spawn fake instances
22 services:
23 - docker
24
25 install:
26 # Install ansible
27 - pip install -r test/requirements.txt
28 # Check ansible version
29 - ansible --version
30 - ansible-galaxy install -r test/requirements.yml -p test/roles/
31
32 script:
33 # Basic role syntax check
34 - ansible-playbook test/main.yml -i test/hosts --syntax-check
35 # Run the tests
36 - ansible-playbook test/main.yml -i test/hosts -e "postgres_version=${POSTGRESQL_VERSION}" -e "debian_release=${DEBIAN_RELEASE}"
37 # FAILS - ansible-playbook test/main.yml -i test/hosts
38 # Even if Docker and docker-py module are present, the tests fail on Travis
39 # The error on Travis is:
40 # => {"changed": false, "item": {"image": "python:3.7-stretch", "links": ["postgres_barman", "postgres_one"], "name": "postgres_three"}, "msg": "Failed to import docker or docker-py - No module named docker. Try `pip install docker` or `pip install docker-py` (Python 2.6)"}
41
42 notifications:
43 webhooks: https://galaxy.ansible.com/api/v1/notifications/