Skip to content

Commit

Permalink
Test Ansible lint in GHA and Ruby in Travis
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ekohl committed Jun 3, 2020
1 parent 42a1595 commit 75aeea0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/ansible.yml
Original file line number Diff line number Diff line change
@@ -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/"
20 changes: 4 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 75aeea0

Please sign in to comment.