From 3b339b1e88406993c41a1d11c8d64e1a9c106734 Mon Sep 17 00:00:00 2001 From: Arthur Meyre Date: Tue, 31 Aug 2021 16:00:52 +0200 Subject: [PATCH] tools: make sphinx-build warnings errors - add -W and --keep-going for SPHINXOPTS - use $(MAKE) for make invocations - build the docs in the conformance phase as the sphinx build has checks --- .github/workflows/continuous-integration.yaml | 26 +++++++++---------- Makefile | 4 +-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 03580a534..8ace055a7 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -49,12 +49,23 @@ jobs: python -m pip install --upgrade pip python -m pip install poetry make setup_env - - name: Conformance + - name: Conformance and Docs build id: conformance if: ${{ success() && !cancelled() }} + env: + # TODO: remove this when JIT doesn't need this + # Required to be sure that docs reads all files with MLIR imports properly + LD_PRELOAD: /compiler/build/lib/Runtime/libZamalangRuntime.so # pcc launches an internal target with proper flags + # docs is run here too as it can fail and we catch errors during the build run: | - make pcc + ./script/make_utils/serialize_targets.sh make pcc docs + - name: Archive docs artifacts + if: ${{ steps.conformance.outcome == 'success' && !cancelled() }} + uses: actions/upload-artifact@v2 + with: + name: html-docs + path: docs/_build/html - name: PyTest id: pytest if: ${{ steps.conformance.outcome == 'success' && !cancelled() }} @@ -89,17 +100,6 @@ jobs: with: path: diff-coverage.txt recreate: true - - name: Build docs - id: docs - if: ${{ steps.conformance.outcome == 'success' && !cancelled() }} - run: | - make docs - - name: Archive docs artifacts - if: ${{ steps.docs.outcome == 'success' && !cancelled() }} - uses: actions/upload-artifact@v2 - with: - name: html-docs - path: docs/_build/html - name: Slack Notification if: ${{ always() }} uses: rtCamp/action-slack-notify@v2 diff --git a/Makefile b/Makefile index bcfae133c..fb3333845 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ setup_env: sync_env: poetry install --remove-untracked - make setup_env + $(MAKE) setup_env .PHONY: sync_env python_format: @@ -135,7 +135,7 @@ docs: clean_docs poetry run sphinx-apidoc -o docs/_apidoc hdk @# Docs - cd docs && poetry run make html + cd docs && poetry run $(MAKE) html SPHINXOPTS='-W --keep-going' .PHONY: docs clean_docs: