Skip to content

Commit

Permalink
WIP: Add downstream testing pipeline
Browse files Browse the repository at this point in the history
Related: #1403
  • Loading branch information
ssbarnea committed Mar 5, 2021
1 parent d69bdf7 commit 8f9c703
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tox.yml
Expand Up @@ -33,6 +33,7 @@ jobs:
env:
- TOXENV: lint
- TOXENV: docs
- TOXENV: eco
- TOXENV: packaging
env:
TOX_PARALLEL_NO_SPINNER: 1
Expand Down
31 changes: 31 additions & 0 deletions playbooks/eco.yml
@@ -0,0 +1,31 @@
#!env ansible-playbook
- hosts: localhost
connection: local
gather_facts: false
vars:
cache_dir: "{{ (playbook_dir, '..', '.cache') | path_join | realpath }}"
repos:
- name: ansible-role-mysql
url: https://github.com/geerlingguy/ansible-role-mysql.git
# - name: zuul-jobs
# url: https://opendev.org/zuul/zuul-jobs
- name: ansible-role-hardening
url: https://github.com/konstruktoid/ansible-role-hardening
- name: ansible-docker-rootless
url: https://github.com/konstruktoid/ansible-docker-rootless
- name: ansible_collection_system
url: https://github.com/devroles/ansible_collection_system
tasks:

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

- name: Run linter
command: ansible-lint -v
args:
chdir: "{{ (playbook_dir, '..', '.cache', item.name) | path_join | realpath }}"
loop: "{{ repos }}"
changed_when: false
13 changes: 13 additions & 0 deletions tox.ini
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 8f9c703

Please sign in to comment.