-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
90 lines (77 loc) · 2.33 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
# -*- mode: yaml -*-
# vim:ts=2:sw=2:ai:si:syntax=yaml
#
# Travis CI configuration
# https://docs.travis-ci.com/
---
# Run tests against pull requests and main branches only
if: |
type = pull_request OR \
branch IN (master, develop)
os: linux
dist: xenial
language: shell
jobs:
include:
- name: "Ubuntu 16.04 LTS with Ansible 2.8"
os: linux
dist: xenial
env: MACHINE_ANSIBLE_VERSION=2.8
- name: "Ubuntu 18.04 LTS with Ansible 2.8"
os: linux
dist: bionic
env: MACHINE_ANSIBLE_VERSION=2.8
- name: "Ubuntu 16.04 LTS with Ansible 2.9"
os: linux
dist: xenial
env: MACHINE_ANSIBLE_VERSION=2.9
- name: "Ubuntu 18.04 LTS with Ansible 2.9"
os: linux
dist: bionic
env: MACHINE_ANSIBLE_VERSION=2.9
- name: "Ubuntu 20.04 LTS with Ansible 2.9"
os: linux
dist: focal
env: MACHINE_ANSIBLE_VERSION=2.9 UPGRADE_GCC=yes
before_install:
# Fix broken Travis Ubuntu 20.04 LTS images with GCC 9.2.1
# https://travis-ci.community/t/please-update-ubuntu-focal-20-04-lts-base-installation-due-to-a-compiling-error-with-gcc-9-2-1/8658
- >
if [[ "$UPGRADE_GCC" == "yes" ]]; then
sudo apt-get update
sudo apt-get install gcc --only-upgrade
fi
# Cleanup existing NVM installation
- unset NVM_CD_FLAGS
- unset NVM_DIR
- unset NVM_BIN
- rm -rf /home/travis/.nvm
- rm -rf /etc/profile.d/travis-nvm.sh
# Remove Go versions installed with Gimme
- >
if [[ -d "/home/travis/.gimme" ]]; then
rm -rf /home/travis/.gimme
fi
# Unset GOROOT and GIMME_ENV variables
- unset GOROOT
- unset GIMME_ENV
# Remove Gimme installed Go version from the PATH
- export PATH=$(echo "${PATH}" | sed 's~/home/travis/.gimme/versions/\([^/]*\)/bin:~~')
script:
# Use Travis test configuration
- cp machine.travis.yaml machine.yaml
# Install roles
- ./setup -n || travis_terminate 1
# Check syntax of the Ansible playbooks
- ./setup -s || travis_terminate 1
# Run playbooks without installing roles
- ./setup -q || travis_terminate 1
# Avoid updating apt cache during idempotence tests
- >
echo "update_apt_cache: false" >> machine.yaml
# Run idempotence tests
- >
./setup -q \
| grep -q 'changed=0.*failed=0' \
&& (echo 'Idempotence test: pass' && exit 0) \
|| (echo 'Idempotence test: fail' && exit 1)