-
Notifications
You must be signed in to change notification settings - Fork 11
Update docs on documentation check workflow #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
elijahgreenstein
wants to merge
1
commit into
canonical:main
Choose a base branch
from
elijahgreenstein:doc-update-workflows
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
112 changes: 112 additions & 0 deletions
112
docs/how-to/optional-customisation/customize-documentation-check-ci.rst
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| :relatedlinks: https://docs.github.com/en/actions/reference/workflows-and-actions | ||
|
|
||
| .. meta:: | ||
| :description: How to modify the Sphinx Stack's default GitHub workflow for documentation checks. | ||
|
|
||
| .. _modify-documentation-check-workflow: | ||
|
|
||
| Customize the documentation check CI | ||
| ==================================== | ||
|
|
||
| The Sphinx Stack provides a GitHub Actions workflow, | ||
| ``.github/workflows/documentation-checks.yaml``, to automate spelling, link, and | ||
| inclusive language checks. This guide describes how to configure the working | ||
| directory and Python version, and how to add or remove documentation checks. | ||
|
|
||
| You can also :ref:`run these checks locally <run-documentation-checks>`. | ||
|
|
||
| Change the working directory | ||
| ---------------------------- | ||
|
|
||
| By default, the workflow uses ``docs`` as the documentation directory. If | ||
| your documentation is located in a different directory, you must modify | ||
| ``documentation-checks.yaml`` in two places: | ||
|
|
||
| * The workflow is configured to run on pull requests that modify files in the | ||
| ``docs`` directory. Find the ``"docs/**"`` string under | ||
| ``on.pull_request.paths``, and replace ``docs`` with the path to your | ||
| documentation. For example, you can change the documentation directory from | ||
| ``docs`` to ``doc``: | ||
|
|
||
| .. code-block:: diff | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| paths: | ||
| - - "docs/**" | ||
| + - "doc/**" | ||
|
|
||
| * In the remainder of ``documentation-checks.yaml``, the working directory is | ||
| configured with the ``DOCS_DIR`` environment variable set under ``env``. | ||
| Change the value of ``DOCS_DIR`` from ``"docs"`` to the path to your | ||
| documentation. | ||
|
|
||
| .. code-block:: diff | ||
|
|
||
| env: | ||
| - DOCS_DIR: "docs" | ||
| + DOCS_DIR: "doc" | ||
| PYTHON_VERSION: "3.10" | ||
|
|
||
| .. note:: | ||
|
|
||
| Do not include a trailing slash character when changing the value of | ||
| the ``DOCS_DIR`` variable. | ||
|
|
||
| Modify the Python version | ||
| ------------------------- | ||
|
|
||
| The Python version is configured with the ``PYTHON_VERSION`` environment | ||
| variable set under ``env``. Change this value to use a different version: | ||
|
|
||
| .. code-block:: diff | ||
|
|
||
| env: | ||
| DOCS_DIR: "docs" | ||
| DOCS_DIR: "doc" | ||
| - PYTHON_VERSION: "3.10" | ||
| + PYTHON_VERSION: "3.12" | ||
|
|
||
| .. note:: | ||
|
|
||
| Place the Python version number in quotation marks. Version numbers without | ||
| quotation marks will be parsed as floating-point numbers, and the GitHub | ||
| Action will fail. | ||
|
|
||
| Add or remove a Makefile target | ||
| ------------------------------- | ||
|
|
||
| The ``documentation-checks.yaml`` workflow uses a matrix strategy to run three | ||
| jobs in parallel: the spelling, links, and inclusive language checks. Each | ||
| check in the matrix defines a ``name`` and a ``target``. The ``name`` is how the | ||
| check is listed when it runs on GitHub, and the ``target`` corresponds to a Make | ||
| target defined in the Sphinx Stack ``Makefile``. The job itself consists of a | ||
| single command: ``make <target>``. | ||
|
|
||
| To add a new ``Makefile`` target to the matrix, add a ``name`` and ``target`` | ||
| pair to the array under ``jobs.checks.strategy.matrix.check``. To remove a | ||
| check, simply remove the lines containing the check's ``name`` and ``target``. | ||
| For example, you can remove the spelling check and add a style guide check: | ||
|
|
||
| .. code-block:: diff | ||
|
|
||
| jobs: | ||
| checks: | ||
| name: ${{ matrix.check.name }} | ||
| runs-on: ubuntu-24.04 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| check: | ||
| - - name: Spelling check | ||
| - target: spelling | ||
| + - name: Style guide check | ||
| + target: vale | ||
| - name: Link check | ||
| target: linkcheck | ||
| - name: Inclusive language check | ||
| target: woke | ||
|
|
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.