]> git.immae.eu Git - github/fretlink/ansible-postgresql-role.git/blame - .travis.yml
tests: running tests on all supported PG versions
[github/fretlink/ansible-postgresql-role.git] / .travis.yml
CommitLineData
d0bc90e0 1---
0415357e 2dist: bionic
d0bc90e0 3language: python
0415357e 4python: "3.8"
d0bc90e0 5
0415357e
P
6# Test on all supported PG versions on both debian stretch and debian buster
7env:
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
d0bc90e0
P
18
19# Install pip
20addons:
21 apt:
22 packages:
23 - python-pip
24
6037b0f8
P
25# Tests are using docker to spawn fake instances
26services:
27 - docker
28
d0bc90e0
P
29install:
30 # Install ansible
0415357e 31 - pip install -r test/requirements.txt
d0bc90e0
P
32 # Check ansible version
33 - ansible --version
c4606fce 34 - ansible-galaxy install -r test/requirements.yml -p test/roles/
d0bc90e0
P
35
36script:
37 # Basic role syntax check
c4606fce 38 - ansible-playbook test/main.yml -i test/hosts --syntax-check
dd54b748 39 # Run the tests
0415357e 40 - ansible-playbook test/main.yml -i test/hosts -e "postgres_version=${POSTGRESQL_VERSION}" -e "debian_release=${DEBIAN_RELEASE}"
6037b0f8
P
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)"}
d0bc90e0
P
45
46notifications:
47 webhooks: https://galaxy.ansible.com/api/v1/notifications/