From 6c2e6ccca871865391f293f3b255ac7c066d2859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 20 Aug 2023 20:30:31 +0200 Subject: [PATCH] Test docs build using CI --- .github/workflows/test-unit.yml | 25 +++++++++++++++++++++++++ docs/baseline.txt | 1 + docs/requirements.txt | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 docs/baseline.txt diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index 289108fed5..0e9e3debee 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -455,3 +455,28 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true files: coverage/merged.xml,coverage/js/clover.xml + + docs-test: + name: Docs + runs-on: ubuntu-latest + container: + image: ghcr.io/mvorisek/image-php:latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Python and dependencies + run: | + apk add python3 py3-pip + python --version + (cd docs && pip install -r requirements.txt) + + - name: Build + run: | + mv docs/baseline.txt docs/baseline.orig.txt + (cd docs && python -m sphinx -T -b html . out 2>&1 | tee baseline.txt) + sed -i -r 's~[^:]*/docs/([^:]*:)([0-9]+:)?~\1~;t;d' docs/baseline.txt + + - name: Diff build baseline + run: | + diff -u docs/baseline.orig.txt docs/baseline.txt diff --git a/docs/baseline.txt b/docs/baseline.txt new file mode 100644 index 0000000000..da2db280c3 --- /dev/null +++ b/docs/baseline.txt @@ -0,0 +1 @@ +testui diff --git a/docs/requirements.txt b/docs/requirements.txt index 8aa7f5d9f9..c91f57ce16 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,5 @@ sphinx<5 sphinx-rtd-theme -sphinxcontrib-phpdomain +sphinxcontrib-phpdomain @ git+https://github.com/markstory/sphinxcontrib-phpdomain@f785b8b333 myst-parser linkify-it-py