-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
55 lines (48 loc) · 1.68 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
sudo: required
language: objective-c
# Reference for OS X Versions:
# https://docs.travis-ci.com/user/reference/osx/#macos-version
matrix:
include:
# Mojave (10.14)
- os: osx
osx_image: xcode11
# High Sierra (10.13)
- os: osx
osx_image: xcode10.1
# Sierra (10.12)
- os: osx
osx_image: xcode9.2
before_install:
# Install role dependencies. Do this here, using newer OpenSSL version and a
# virtualenv because older macOS versions will fail with the system version of
# OpenSSL and Python if done later.
- brew upgrade openssl || brew install openssl || true
- brew upgrade python3 || brew install python3 || true
- sudo -H pip3 install -U virtualenv
- virtualenv --python=/usr/local/bin/python3 .venv
- source .venv/bin/activate
- pip install ansible
- python -c "import ssl; print(ssl.OPENSSL_VERSION)"
# Add ansible.cfg to pick up roles path.
- "{ echo '[defaults]'; echo 'roles_path = ../:../roles:./roles'; } >> ansible.cfg"
# Add a hosts file.
- sudo mkdir -p /etc/ansible
- sudo touch /etc/ansible/hosts
- "echo -e '[local]\nlocalhost ansible_connection=local' | sudo tee -a /etc/ansible/hosts > /dev/null"
script:
# Check the role/playbook's syntax.
- "ansible-playbook tests/test.yml --syntax-check"
# Test the playbook.
- "ansible-playbook tests/test.yml"
# Test the playbook's idempotence.
- idempotence=$(mktemp)
- "ansible-playbook tests/test.yml | tee -a ${idempotence}"
- >
tail ${idempotence}
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/