2019-12-16 14:35:22 -04:00
|
|
|
name: Docs
|
|
|
|
|
|
|
|
on:
|
2023-05-28 12:21:29 -03:00
|
|
|
workflow_call:
|
2021-10-21 17:34:18 -03:00
|
|
|
workflow_dispatch:
|
2019-12-16 14:35:22 -04:00
|
|
|
|
2022-05-21 04:55:21 -03:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2022-10-08 16:21:38 -03:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2019-12-16 14:35:22 -04:00
|
|
|
jobs:
|
|
|
|
build_doc:
|
|
|
|
name: 'Docs'
|
|
|
|
runs-on: ubuntu-latest
|
2023-04-14 06:01:10 -03:00
|
|
|
timeout-minutes: 60
|
2019-12-16 14:35:22 -04:00
|
|
|
steps:
|
2022-04-20 00:50:07 -03:00
|
|
|
- uses: actions/checkout@v3
|
2022-06-15 04:56:16 -03:00
|
|
|
- name: 'Set up Python'
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: '3'
|
|
|
|
cache: 'pip'
|
|
|
|
cache-dependency-path: 'Doc/requirements.txt'
|
|
|
|
- name: 'Install build dependencies'
|
|
|
|
run: make -C Doc/ venv
|
|
|
|
|
2023-07-22 05:12:43 -03:00
|
|
|
# To annotate PRs with Sphinx nitpicks (missing references)
|
2023-03-24 08:23:35 -03:00
|
|
|
- name: 'Get list of changed files'
|
2023-04-26 17:20:19 -03:00
|
|
|
if: github.event_name == 'pull_request'
|
2023-03-24 08:23:35 -03:00
|
|
|
id: changed_files
|
|
|
|
uses: Ana06/get-changed-files@v2.2.0
|
2023-03-25 04:15:02 -03:00
|
|
|
with:
|
|
|
|
filter: "Doc/**"
|
2023-06-21 07:42:59 -03:00
|
|
|
format: csv # works for paths with spaces
|
2023-07-22 05:12:43 -03:00
|
|
|
- name: 'Build HTML documentation'
|
2023-03-24 08:23:35 -03:00
|
|
|
continue-on-error: true
|
|
|
|
run: |
|
2023-06-21 07:42:59 -03:00
|
|
|
set -Eeuo pipefail
|
2023-07-22 05:12:43 -03:00
|
|
|
# Build docs with the '-n' (nit-picky) option; write warnings to file
|
|
|
|
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going -w sphinx-warnings.txt" html
|
|
|
|
- name: 'Check warnings'
|
|
|
|
if: github.event_name == 'pull_request'
|
2023-03-24 08:23:35 -03:00
|
|
|
run: |
|
2023-07-22 05:12:43 -03:00
|
|
|
python Doc/tools/check-warnings.py \
|
|
|
|
--check-and-annotate '${{ steps.changed_files.outputs.added_modified }}' \
|
|
|
|
--fail-if-regression \
|
|
|
|
--fail-if-improved
|
2023-03-24 08:23:35 -03:00
|
|
|
|
2023-04-27 15:27:38 -03:00
|
|
|
# This build doesn't use problem matchers or check annotations
|
|
|
|
build_doc_oldest_supported_sphinx:
|
|
|
|
name: 'Docs (Oldest Sphinx)'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 60
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: 'Set up Python'
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: '3.11' # known to work with Sphinx 3.2
|
|
|
|
cache: 'pip'
|
|
|
|
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
|
|
|
|
- name: 'Install build dependencies'
|
|
|
|
run: make -C Doc/ venv REQUIREMENTS="requirements-oldest-sphinx.txt"
|
|
|
|
- name: 'Build HTML documentation'
|
|
|
|
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
|
|
|
|
|
2022-06-15 04:56:16 -03:00
|
|
|
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
|
|
|
|
doctest:
|
|
|
|
name: 'Doctest'
|
|
|
|
runs-on: ubuntu-latest
|
2023-04-14 06:01:10 -03:00
|
|
|
timeout-minutes: 60
|
2022-06-15 04:56:16 -03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ubuntu-doc-${{ hashFiles('Doc/requirements.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
ubuntu-doc-
|
2020-01-17 19:44:38 -04:00
|
|
|
- name: 'Install Dependencies'
|
|
|
|
run: sudo ./.github/workflows/posix-deps-apt.sh && sudo apt-get install wamerican
|
|
|
|
- name: 'Configure CPython'
|
|
|
|
run: ./configure --with-pydebug
|
|
|
|
- name: 'Build CPython'
|
2020-02-26 15:21:41 -04:00
|
|
|
run: make -j4
|
2019-12-16 14:35:22 -04:00
|
|
|
- name: 'Install build dependencies'
|
2020-01-17 19:44:38 -04:00
|
|
|
run: make -C Doc/ PYTHON=../python venv
|
2021-12-09 19:02:20 -04:00
|
|
|
# Use "xvfb-run" since some doctest tests open GUI windows
|
|
|
|
- name: 'Run documentation doctest'
|
2022-07-30 19:21:08 -03:00
|
|
|
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="-W --keep-going" doctest
|