-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
20 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |