diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 0ba7501056..65bf2abbf9 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -32,6 +32,7 @@ jobs: env: - TOXENV: lint - TOXENV: docs + - TOXENV: eco - TOXENV: packaging env: TOX_PARALLEL_NO_SPINNER: 1 diff --git a/playbooks/eco.yml b/playbooks/eco.yml new file mode 100755 index 0000000000..0a5597d24a --- /dev/null +++ b/playbooks/eco.yml @@ -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 diff --git a/tox.ini b/tox.ini index a35ae3b582..49f741cf80 100644 --- a/tox.ini +++ b/tox.ini @@ -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 =