forked from elliotweiser/ansible-osx-command-line-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
109 lines (93 loc) · 2.58 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
sudo: required
language: generic
matrix:
include:
# Catalina (Latest)
- os: osx
osx_image: xcode10.4
env: ANSIBLE_VERSION='<2.9.0'
# Catalina (Ansible 2.7)
- os: osx
osx_image: xcode10.3
env: ANSIBLE_VERSION='<2.8.0'
# Mojave
- os: osx
osx_image: xcode10.3
env: ANSIBLE_VERSION='<2.9.0'
# High Sierra
- os: osx
osx_image: xcode10.1
env: ANSIBLE_VERSION='<2.9.0'
# Sierra
- os: osx
osx_image: xcode9.2
env: ANSIBLE_VERSION='<2.9.0'
# El Capitan
- os: osx
osx_image: xcode8
env: ANSIBLE_VERSION='<2.9.0'
branches:
only:
- master
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
before_install:
# Unwind the developer environment
- URL=https://raw.githubusercontent.com/Homebrew/install/master/uninstall
- curl -sLO "${URL}"
- chmod +x uninstall
- yes | ./uninstall --force
- sudo rm -rf /usr/local/Homebrew
- sudo rm -rf /usr/local/Caskroom
- sudo rm -rf /usr/local/bin/brew
- sudo rm -rf /usr/local/Cellar
- sudo rm -rf /Library/Developer/CommandLineTools
# Install pip
- curl https://bootstrap.pypa.io/get-pip.py | sudo -H /usr/bin/python
- which pip
- pip --version
# Setup virtualenv
- sudo -H pip install -U virtualenv --ignore-installed six
- virtualenv --version
- virtualenv .venv
- source .venv/bin/activate
install:
# Upgrade setuptools and install setuptools_scm (for testinfra)
- pip install -U setuptools setuptools_scm
# Dependencies
- >-
pip install "ansible${ANSIBLE_VERSION}"
ansible-lint
testinfra
yamllint
requests
# Check versions
- ansible --version
- ansible-lint --version
- py.test --version
- yamllint --version
script:
# Check available releases
- python tests/version_check.py
# Lint all YAML files.
- yamllint .
# Check the role/playbook's syntax.
- ansible-playbook tests/playbook.yml --syntax-check
# Lint the playbook.
- ansible-lint tests/playbook.yml
# Simple syntax check
- ansible-playbook --syntax-check tests/playbook.yml
# Test the playbook.
- ansible-playbook tests/playbook.yml
# Test the playbook's idempotence.
- idempotence=$(mktemp /private/tmp/XXXXXXXXX)
- ansible-playbook tests/playbook.yml | tee -a ${idempotence}
- >-
tail -25 ${idempotence} |
grep -q 'changed=0.*failed=0' &&
(echo 'Idempotence test: pass' && exit 0) ||
(echo 'Idempotence test: fail' && exit 1)
# Test host state
- py.test --connection=local --hosts=localhost --verbose tests
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/