From 75aeea09a143821c45d4c1364d7ddedae672f2a2 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 12 Mar 2020 12:48:42 +0100 Subject: [PATCH] Test Ansible lint in GHA and Ruby in Travis The Github Action setup-ruby doesn't support Ruby 2.0. However, there is an action to test ansible-lint. This switches the Python based testing to that and makes Travis a pure Ruby env. --- .github/workflows/ansible.yml | 16 ++++++++++++++++ .travis.yml | 20 ++++---------------- 2 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/ansible.yml diff --git a/.github/workflows/ansible.yml b/.github/workflows/ansible.yml new file mode 100644 index 000000000..29c8d4fc1 --- /dev/null +++ b/.github/workflows/ansible.yml @@ -0,0 +1,16 @@ +name: Ansible Lint + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Lint Ansible Playbook + uses: ansible/ansible-lint-action@master + with: + targets: | + playbooks/* + roles/* + args: "-r rules/" diff --git a/.travis.yml b/.travis.yml index 4956bffff..f166e74f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,11 @@ -language: python -python: - - 2.7 +language: ruby +rvm: + - "2.0.0" dist: bionic -addons: - apt: - packages: - - ansible-lint - - ruby-bundler script: - | if git diff origin/master --name-only | grep -q "vagrant"; then cd vagrant - bundle install + bundle install --jobs=3 --retry=3 bundle exec rake fi - - - | - if git diff origin/master --name-only | grep -q "playbooks\|roles\|containers/roles"; then - ansible-lint -r rules/ playbooks/* - ansible-lint -r rules/ roles/* - ansible-lint -r rules/ containers/roles/* - fi