Skip to content

Commit

Permalink
Add downstream testing pipeline
Browse files Browse the repository at this point in the history
Related: #1403
  • Loading branch information
ssbarnea committed Mar 6, 2021
1 parent 262268f commit b62c191
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
env:
- TOXENV: lint
- TOXENV: docs
- TOXENV: eco
- TOXENV: packaging
env:
TOX_PARALLEL_NO_SPINNER: 1
Expand Down
38 changes: 38 additions & 0 deletions playbooks/eco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!env ansible-playbook
- hosts: localhost
connection: local
gather_facts: false
vars:
cache_dir: "{{ (lookup('env','HOME'), '.cache', 'ansible-lint-eco') | path_join | realpath }}"
repos:
- name: ansible-role-mysql
url: https://github.com/geerlingguy/ansible-role-mysql.git
contact: geerlingguy
# Enable after: https://review.opendev.org/c/zuul/zuul-jobs/+/773245
# - name: zuul-jobs
# url: https://opendev.org/zuul/zuul-jobs
# contact: ssbarnea
- name: ansible-role-hardening
url: https://github.com/konstruktoid/ansible-role-hardening
contact: konstruktoid
- name: ansible-docker-rootless
url: https://github.com/konstruktoid/ansible-docker-rootless
contact: konstruktoid
# Enable after: https://github.com/devroles/ansible_collection_system/pull/1
# - name: ansible_collection_system
# url: https://github.com/devroles/ansible_collection_system
# contact: greg-hellings
tasks:

- name: Clone repo
git:
repo: "{{ item.url }}"
dest: "{{ (cache_dir, item.name) | path_join }}"
loop: "{{ repos }}"

- name: Run linter
command: ansible-lint -v
args:
chdir: "{{ (cache_dir, item.name) | path_join }}"
loop: "{{ repos }}"
changed_when: false
13 changes: 13 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ commands =
'print("\n" + "=" * 120 + f"\n\nDocumentation available under `file://\{index_file\}`\n\nTo serve docs, use `python3 -m http.server --directory \{docs_dir\} 0`\n\n" + "=" * 120)'
changedir = {toxinidir}/docs

[testenv:eco]
description = Perform ecosystem impact (downstream testing) https://github.com/ansible-community/ansible-lint/discussions/1403
commands =
ansible-playbook -i localhost, playbooks/eco.yml
extras =
yamllint
community
setenv =
ANSIBLE_NOCOWS=1
ANSIBLE_STDOUT_CALLBACK=yaml
ANSIBLE_FORCE_COLOR=1
NO_COLOR=1

[testenv:packaging]
basepython = python3
description =
Expand Down

0 comments on commit b62c191

Please sign in to comment.