]> git.immae.eu Git - github/fretlink/ansible-postgresql-role.git/blob - .travis.yml
c84bc8082a5375ee20ea46ff9e4d8fb13fd7a4e7
[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=9.5 DEBIAN_RELEASE=stretch
9 - POSTGRESQL_VERSION=9.6 DEBIAN_RELEASE=stretch
10 - POSTGRESQL_VERSION=10 DEBIAN_RELEASE=stretch
11 - POSTGRESQL_VERSION=11 DEBIAN_RELEASE=stretch
12 - POSTGRESQL_VERSION=12 DEBIAN_RELEASE=stretch
13 - POSTGRESQL_VERSION=9.5 DEBIAN_RELEASE=buster
14 - POSTGRESQL_VERSION=9.6 DEBIAN_RELEASE=buster
15 - POSTGRESQL_VERSION=10 DEBIAN_RELEASE=buster
16 - POSTGRESQL_VERSION=11 DEBIAN_RELEASE=buster
17 - POSTGRESQL_VERSION=12 DEBIAN_RELEASE=buster
18
19 # Install pip
20 addons:
21 apt:
22 packages:
23 - python-pip
24
25 # Tests are using docker to spawn fake instances
26 services:
27 - docker
28
29 install:
30 # Install ansible
31 - pip install -r test/requirements.txt
32 # Check ansible version
33 - ansible --version
34 - ansible-galaxy install -r test/requirements.yml -p test/roles/
35
36 script:
37 # Basic role syntax check
38 - ansible-playbook test/main.yml -i test/hosts --syntax-check
39 # Run the tests
40 - ansible-playbook test/main.yml -i test/hosts -e "postgres_version=${POSTGRESQL_VERSION}" -e "debian_release=${DEBIAN_RELEASE}"
41 # FAILS - ansible-playbook test/main.yml -i test/hosts
42 # Even if Docker and docker-py module are present, the tests fail on Travis
43 # The error on Travis is:
44 # => {"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)"}
45
46 notifications:
47 webhooks: https://galaxy.ansible.com/api/v1/notifications/