From b32b1b02cc7fd9cc47d4c9e9424d5b78d596c5f0 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Thu, 29 Oct 2020 11:54:12 -0300 Subject: [PATCH 1/2] Add action to verify Ansible documentation on each commit or PR. This change add support for running ansible-doc-test on every commit or PR, ensuring that roles and modules are able to produce correct documentation with ansible-doc. --- .github/workflows/docs.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..b2aa5f74 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,16 @@ +--- +name: Verify Ansible documentation. +on: + - push + - pull_request +jobs: + check_docs: + name: Check Ansible Documentation. + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Run ansible-doc-test + run: ANSIBLE_LIBRARY="." python utils/ansible-doc-test roles plugins From 18d90c70b359d3f9fb5e5972fb28a75b7a1dc641 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Tue, 17 Nov 2020 13:53:10 -0300 Subject: [PATCH 2/2] ansible-doc-test: Ignore role if library directory does not exist. This change make ansible-doc-test skip processing a role if it does not contain a `library` directory. --- utils/ansible-doc-test | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/ansible-doc-test b/utils/ansible-doc-test index a7c29853..dc09afc5 100755 --- a/utils/ansible-doc-test +++ b/utils/ansible-doc-test @@ -124,7 +124,10 @@ def ansible_doc_test(path, verbose): # All roles and plugins roles = os.listdir("roles/") for _role in roles: - if not os.path.isdir("roles/%s" % _role): + if ( + not os.path.isdir("roles/%s" % _role) + or not os.path.isdir("roles/%s/library" % _role) + ): continue modules = os.listdir("roles/%s/library" % _role) for _module in modules: