-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
77 lines (71 loc) · 2.52 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
---
language: go
go:
- "1.12.4"
python:
- 2.7
services: docker
env:
- distro: ubuntu1204
- distro: ubuntu1210
- distro: ubuntu1304
- distro: ubuntu1310
- distro: ubuntu1404
- distro: ubuntu1410
- distro: ubuntu1504
- distro: ubuntu1510
- distro: ubuntu1604
- distro: ubuntu1610
- distro: ubuntu1704
- distro: ubuntu1710
- distro: ubuntu1804
- distro: ubuntu1810
- distro: ubuntu1904
- distro: ubuntu2004
- distro: centos6
- distro: centos7
- distro: debian8
- distro: debian9
- distro: debian10
- distro: fedora24
- distro: fedora25
- distro: fedora26
- distro: fedora27
- distro: fedora28
- distro: fedora29
- distro: fedora30
- distro: fedora31
before_install:
# Install dependencies:
- sudo pip install --upgrade pip
- sudo pip install ansible
# Install golang deps
- GO111MODULE=on go mod download
- GO111MODULE=on go install .
# Style checks
- diff -u <(echo -n) <(gofmt -d $(find . -not -path "./vendor/*" -name "*.go"))
- GO111MODULE=on go vet $(go list ./...)
# Download repos used in testing
- git clone https://github.com/fubarhouse/ansible-role-curl.git ${TRAVIS_HOME}/my_role
- git clone https://github.com/issmirnov/ansible-role-art-tester.git ${TRAVIS_HOME}/ansible-role-art-tester
script:
# Test the role from inside the container using the segmented commands.
- cd ${TRAVIS_HOME}/my_role
- ansible-role-tester run --name travis_test --user fubarhouse --distribution ${distro}
- ansible-role-tester install --name travis_test
- ansible-role-tester test --name travis_test --playbook ./tests/test-package.yml
- ansible-role-tester destroy --name travis_test
- sleep 10
# Change the test playbook to work with remote hosts (inventory)
- sed -i -e 's/- hosts:\ localhost/- hosts:\ all/g' ${TRAVIS_HOME}/my_role/tests/test-package.yml
# Change the test playbook to refer to the correct path for the role.
- sed -i -e 's/role_under_test/\/home\/travis\/my_role\//g' ${TRAVIS_HOME}/my_role/tests/test-package.yml
# Test the role from outside the container using the one standard pipeline command.
- ansible-role-tester full --name travis_test --user fubarhouse --distribution ${distro} --playbook tests/test-package.yml --remote
# Phase 2: test other flags
- cd ${TRAVIS_HOME}/ansible-role-art-tester
- ansible-role-tester full --playbook tests/playbook-library.yml --library "$(pwd)/tests/library"
# Phase 3: run goconvey tests
- cd ${TRAVIS_BUILD_DIR} && go test -short -v ./...
notifications:
slack: fubarhouse:upHoIzmKb4ikkBOt2cOwgKXY