Skip to content

Commit

Permalink
Add downstream testing pipeline (#1434)
Browse files Browse the repository at this point in the history
Related: #1403
  • Loading branch information
ssbarnea authored Mar 10, 2021
1 parent 57aa3b8 commit c9f27fa
Show file tree
Hide file tree
Showing 3 changed files with 53 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 @@ -32,6 +32,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
14 changes: 14 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ 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_FORCE_COLOR=1
ANSIBLE_NOCOWS=1
ANSIBLE_PYTHON_INTERPRETER=auto_silent
ANSIBLE_STDOUT_CALLBACK=yaml
NO_COLOR=1

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

0 comments on commit c9f27fa

Please sign in to comment.