Addons for release and publication #20
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/ansible-doc-validation.yml | |
name: Ansible Doc Validation | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
env: | |
COLLECTION_NAMESPACE: cisco | |
COLLECTION_NAME: catalystwan | |
jobs: | |
documentation-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install Ansible | |
run: pip install ansible==9.4.0 | |
- name: Build and install the collection | |
run: | | |
ansible-galaxy collection build $GITHUB_WORKSPACE --force | |
ansible-galaxy collection install $GITHUB_WORKSPACE/*.tar.gz | |
- name: List modules in the collection | |
shell: bash | |
run: | | |
MODULES_PATH="$GITHUB_WORKSPACE/plugins/modules/" | |
MODULES=$(find "$MODULES_PATH" -name '*.py' -exec basename {} .py \; | xargs) | |
echo "Modules found: $MODULES" | |
echo "MODULES=$MODULES" >> $GITHUB_ENV | |
- name: Check documentation for each module | |
shell: bash | |
run: | | |
for MODULE in $MODULES; do | |
echo "Checking module: $MODULE documentation" | |
if ! ansible-doc --type=module --json "${{ env.COLLECTION_NAMESPACE }}.${{ env.COLLECTION_NAME }}.$MODULE" > /dev/null; then | |
echo "Error in documentation for module $MODULE" | |
exit 1 | |
fi | |
done |