Language: validate module descriptors without native loading #1110
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
| name: Docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: docs-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| html: | |
| # Mirrors what Read the Docs does: install the docs extra from uv.lock with | |
| # no source builds, then build. No compiler, no hgraph import. If this job | |
| # needs hgraph importable, the docs have grown a dependency RTD cannot | |
| # satisfy. | |
| name: HTML (warnings are errors) | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| run: >- | |
| python -m pip install --upgrade --only-binary=:all: "uv==0.12.3" | |
| # Pinned by uv.lock; --no-build forbids building any source distribution, | |
| # so no dependency setup script runs. | |
| - name: Install documentation dependencies | |
| run: >- | |
| uv sync --frozen --extra docs --no-install-workspace --no-build | |
| --python 3.12 | |
| - name: Build HTML | |
| run: .venv/bin/python -m sphinx -W --keep-going -b html docs/source docs/_build/html | |
| - name: Check external and internal links | |
| continue-on-error: true | |
| run: .venv/bin/python -m sphinx -b linkcheck docs/source docs/_build/linkcheck | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| if: always() | |
| with: | |
| name: docs-html | |
| path: docs/_build/html | |
| retention-days: 7 | |
| doctest: | |
| # The narrative documentation's examples are executable. This job is what | |
| # makes that claim true: it builds the extension, then runs every | |
| # `testcode`/`testoutput` pair in the tree against the real runtime. | |
| name: Doctest the examples | |
| runs-on: ubuntu-24.04 | |
| env: | |
| GCC_VERSION: "14" | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Configure GCC 14 | |
| run: | | |
| cc_path="$(command -v "gcc-$GCC_VERSION")" | |
| cxx_path="$(command -v "g++-$GCC_VERSION")" | |
| echo "CC=$cc_path" >> "$GITHUB_ENV" | |
| echo "CXX=$cxx_path" >> "$GITHUB_ENV" | |
| - name: Install uv | |
| run: >- | |
| python -m pip install --upgrade --only-binary=:all: "uv==0.12.3" | |
| # This job cannot use --no-build: hgraph is a C++ extension and compiling | |
| # it from this checkout is the whole point of the job. Everything else is | |
| # pinned by uv.lock and --no-binary-package is not needed because the | |
| # third-party wheels are prebuilt. `--extra test` is needed alongside | |
| # `docs`: two tutorial examples use pytest.raises to show the wiring error | |
| # they are teaching. | |
| - name: Build hgraph and install the docs dependencies | |
| run: uv sync --frozen --extra docs --extra test --python 3.12 | |
| - name: Run doctests | |
| run: .venv/bin/python -m sphinx -W --keep-going -b doctest docs/source docs/_build/doctest | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| if: failure() | |
| with: | |
| name: docs-doctest-output | |
| path: docs/_build/doctest | |
| retention-days: 7 |