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 Mar 12, 2020
1 parent 59032bd commit e308a2d
Show file tree
Hide file tree
Showing 2 changed files with 19 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/"
19 changes: 3 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
language: python
python:
- 2.7
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 e308a2d

Please sign in to comment.