Modernize TravisCI

new_release
Emilien Mantel 2021-09-01 13:49:16 +02:00
parent 1f289107ff
commit a052b45073
1 changed files with 28 additions and 12 deletions

View File

@ -1,28 +1,36 @@
--- ---
env: env:
- PLATFORM='docker-buster-default-master' ANSIBLE_VERSION='ansible>=2.9,<2.10' global:
- PLATFORM='docker-buster-upstream-master' ANSIBLE_VERSION='ansible>=2.9,<2.10' - VAGRANT_VERSION='2.2.18'
- PLATFORM='docker-buster-default-galera-1' ANSIBLE_VERSION='ansible>=2.9,<2.10' jobs:
- PLATFORM='docker-buster-upstream-galera-1' ANSIBLE_VERSION='ansible>=2.9,<2.10' - PLATFORM='docker-buster-default-master' ANSIBLE_VERSION='ansible>=2.11,<2.12'
- PLATFORM='docker-buster-upstream-master' ANSIBLE_VERSION='ansible>=2.11,<2.12'
- PLATFORM='docker-buster-default-galera-1' ANSIBLE_VERSION='ansible>=2.11,<2.12'
- PLATFORM='docker-buster-upstream-galera-1' ANSIBLE_VERSION='ansible>=2.11,<2.12'
sudo: required os:
- linux
dist: trusty dist: focal
language: python language: python
python: 2.7 python:
- 3.8
services: services:
- docker - docker
before_install: before_install:
- wget https://releases.hashicorp.com/vagrant/2.1.1/vagrant_2.1.1_x86_64.deb - sudo apt-get -q update
- sudo dpkg -i vagrant_2.1.1_x86_64.deb - sudo apt-get install -y yamllint
- vagrant plugin install vagrant-hostmanager - sudo wget -nv https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_x86_64.deb
- sudo dpkg -i vagrant_${VAGRANT_VERSION}_x86_64.deb
install: install:
- pip install "$ANSIBLE_VERSION" - sudo pip install "ansible-core$ANSIBLE_VERSION"
- sudo pip install ansible-lint
- ansible-galaxy collection install community.general
- ansible-galaxy install -p ./tests HanXHX.php
script: script:
- VAGRANT_DEFAULT_PROVIDER=docker vagrant up $PLATFORM - VAGRANT_DEFAULT_PROVIDER=docker vagrant up $PLATFORM
@ -32,6 +40,14 @@ script:
&& (echo 'Idempotence test: pass' && exit 0) && (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1) || (echo 'Idempotence test: fail' && exit 1)
- VAGRANT_DEFAULT_PROVIDER=docker vagrant status - VAGRANT_DEFAULT_PROVIDER=docker vagrant status
- >
yamllint .
&& (echo 'YAML lint test: pass' && exit 0)
|| (echo 'YAML lint test: fail' && exit 1)
- >
ansible-lint -v tests/test.yml
&& (echo 'Ansible lint test: pass' && exit 0)
|| (echo 'Ansible lint test: fail' && exit 1)
notifications: notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/ webhooks: https://galaxy.ansible.com/api/v1/notifications/