diff --git a/.github/workflows/automatic-doc-checks.yml b/.github/workflows/automatic-doc-checks.yml index 66c917d5..3fc60b69 100644 --- a/.github/workflows/automatic-doc-checks.yml +++ b/.github/workflows/automatic-doc-checks.yml @@ -1,23 +1,53 @@ -# -name: Automatic doc checks +name: Documentation on: push: - branches: [ main ] + branches: + - main pull_request: paths: - - 'docs/**' # Only run on changes to the docs directory + - "docs/**" - workflow_dispatch: - # Manual trigger +env: + DOCS_DIR: "docs" + PYTHON_VERSION: "3.10" + +permissions: + contents: read concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: true jobs: - documentation-checks: - uses: canonical/documentation-workflows/.github/workflows/documentation-checks.yaml@main - with: - working-directory: "docs" - fetch-depth: 0 + checks: + name: ${{ matrix.check.name }} + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + check: + - name: Spelling check + target: spelling + - name: Link check + target: linkcheck + - name: Inclusive language check + target: woke + defaults: + run: + working-directory: ${{ env.DOCS_DIR }} + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: "pip" + cache-dependency-path: ${{ env.DOCS_DIR }}/requirements.txt + + - name: Run check + run: make ${{ matrix.check.target }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 268e2353..6a3f77c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * Skip pa11y installation if it is already present * Update `CONTRIBUTING.md` to include versioning and breaking changes policy * Remove extensions deprecated in 2.0 +* Replace remote documentation checks in CI ### Changed @@ -16,9 +17,9 @@ * `docs/Makefile` [#605](https://github.com/canonical/sphinx-stack/pull/605), [#610](https://github.com/canonical/sphinx-stack/pull/610), [#627](https://github.com/canonical/sphinx-stack/pull/627), [#628](https://github.com/canonical/sphinx-stack/pull/628) * `docs/requirements.txt` [#634](https://github.com/canonical/sphinx-stack/pull/634), [#646](https://github.com/canonical/sphinx-stack/pull/646) * `README.md` [#603](https://github.com/canonical/sphinx-stack/pull/603) +* `.github/workflows/automatic-doc-checks.yml` [#642](https://github.com/canonical/sphinx-stack/pull/642) * `.github/workflows/cla-check.yml` [#606](https://github.com/canonical/sphinx-stack/pull/606) * `.github/workflows/check-removed-urls.yml` [#612](https://github.com/canonical/sphinx-stack/pull/#612) -* `CONTRIBUTING.md` [#632](https://github.com/canonical/sphinx-stack/pull/632) ## 2.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 62d01a34..6c1d0174 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -349,17 +349,16 @@ branches should ensure they have signed the CLA before their changes are merged ### Checks on changes to `docs/` only -- Markdown style check: Runs `pymarkdownlnt` on Markdown files -- Automatic documentation checks: Runs upstream documentation workflow checks. The - project uses - [canonical/documentation-workflows](https://github.com/canonical/documentation-workflows) - for automatic documentation checks. To modify this part of CI behavior, pass inputs to - upstream workflows rather than creating or customizing local copies. +- Spelling check: Checks spelling in the documentation with Vale +- Link check: Check external links in the documentation with the Sphinx `linkcheck` + builder +- Inclusive language check: Ensure the documentation uses inclusive language with Vale +- Markdown style check: Lint the Markdown source with `pymarkdownlnt` ### Optional checks (allowed to fail) -- Style guide check (`vale`): Checks compliance with the Canonical style guide -- Accessibility check (`pa11y`): Checks accessibility of generated HTML +- Style guide check: Checks compliance with the Canonical style guide with Vale +- Accessibility check: Checks the accessibility of generated HTML with Pa11y ## Review process