Skip to content

Commit

Permalink
Add docs building and testing
Browse files Browse the repository at this point in the history
- Allows local build using tox -e docs
- Builds docs using GHA
- Builds and publishes docs using RTD (including PRs)
  • Loading branch information
ssbarnea committed Aug 20, 2024
1 parent a92be59 commit 239a4c7
Show file tree
Hide file tree
Showing 23 changed files with 7,491 additions and 23 deletions.
41 changes: 23 additions & 18 deletions .config/dictionary.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
-CAcreateserial
-Djava
ARGSPEC
AUTHS
Abhijeet
Alina
Buzachis
EDAHTTP
FQCN
GSSAPI
Kasurde
Nikhil
OAUTHBEARER
PYTHONUNBUFFERED
Passw
akasurde
alertmanager
alinabuzachis
antsibull
auths
basepython
benthomasosn
bindep
buildx
cafile
capath
caroot
cliconf
confluentinc
conninfo
containerd
Expand All @@ -21,19 +36,25 @@ dynatrace
envlist
extfile
finito
hdrs
healthcheck
httpapi
jaas
jainnikhil
keygen
keypass
keytool
libsystemd
mydb
myqueue
nada
netconf
noprompt
parseable
posargs
pythonmain
realworld
refspec
rulebook
rulebooks
ruleset
Expand All @@ -42,24 +63,8 @@ skipsdist
snakeoil
storepass
testenv
testsecret
testuser
toxinidir
trustore
truststore
ARGSPEC
Nikhil
jainnikhil
Abhijeet
Kasurde
akasurde
auths
Passw
AUTHS
EDAHTTP
refspec
Alina
Buzachis
alinabuzachis
hdrs
testuser
testsecret
keygen
15 changes: 14 additions & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
# can be different. Each of them is testing with all supported
# python versions, regardless the tox pyXY name.
other_names: |
lint-sanity:tox -e lint;tox -e py39-sanity-ansible2.15;tox -e py310-sanity-ansible2.16;tox -e py311-sanity-ansible2.17
lint-docs-sanity:tox -e lint;tox -e docs;tox -e py39-sanity-ansible2.15;tox -e py310-sanity-ansible2.16;tox -e py311-sanity-ansible2.17
py39:tox -e py39-unit;tox -e py39-integration;tox -e coverage
py310:tox -e py310-unit; tox -e py310-integration;tox -e coverage
py311:tox -e py311-unit; tox -e py311-integration;tox -e coverage
Expand All @@ -57,6 +57,7 @@ jobs:
runs-on: ${{ matrix.os || 'ubuntu-24.04' }}
continue-on-error: ${{ contains(matrix.name, 'integration') && true || false }}
needs:
- docs
- prepare
defaults:
run:
Expand Down Expand Up @@ -130,6 +131,9 @@ jobs:
- run: ${{ matrix.command4 }}
if: ${{ matrix.command4 }}

- run: ${{ matrix.command5 }}
if: ${{ matrix.command5 }}

- name: Archive logs
uses: actions/upload-artifact@v4
with:
Expand All @@ -150,6 +154,15 @@ jobs:
exit 99
fi
# https://github.com/actions/toolkit/issues/193
docs:
permissions:
contents: read
name: Validate Ansible Docs
uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-pr.yml@main
with:
collection-name: ansible.eda
init-lenient: false
init-fail-on-error: true
check:
if: always()
environment: check
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ tests/integration/event_source_kafka/*.jks
# Coverage
.coverage*
*coverage.combined
# docs/requirements.txt
docs/build.sh
docs/antsibull-docs.cfg
docs/conf.py
6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ ci:
- ansible-test-sanity # requires network access
- shellcheck # no docker
- tox # requires network access
exclude: "^.*\\.md$"
exclude: >
(?x)^(
docs/rst/.*.rst$|
test/fixtures/formatting-before/.*
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand Down
24 changes: 24 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-24.04
tools:
python: "3.12"
# When using commands we canon install apt_package due to
# apt_packages:
# - rsync
commands:
- echo $PATH
- curl -O /tmp/rsync.tar.gz https://download.samba.org/pub/rsync/binaries/ubuntu-22.04-x86_64/rsync-3.2.7.tar.gz
- tar -xzf rsync.tar.gz
- cp /tmp/usr/local/bin/rsync ~/.local/bin/
- type rsync
- pip install --user tox
- python3 -m tox -e docs
- ln -s docs/build/html . $READTHEDOCS_OUTPUT/html/
2 changes: 1 addition & 1 deletion demos/dynatrace-demo/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rulebook CLI runs a remedy playbook to restart the process.
### Nodes or instances
* Rulebook Node: The node where the ansible-rulebook CLI is running
* Client Node: The node where the monitored process is running
* Dynatrace Console: An active Dyntrace tenant and its web console
* Dynatrace Console: An active Dynatrace tenant and its web console

### Set up client node
1. Prepare a VM with host name called `lamp`
Expand Down
8 changes: 8 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

# Created with antsibull-docs 2.12.0

/temp-rst
/build
10 changes: 10 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

# Created with antsibull-docs 2.12.0

antsibull-docs >= 2.0.0, < 3.0.0
ansible-pygments
sphinx
sphinx-ansible-theme >= 0.9.0
Loading

0 comments on commit 239a4c7

Please sign in to comment.