Skip to content

Commit

Permalink
Improve CI
Browse files Browse the repository at this point in the history
Improve CI build times by using a dummy builder for (empty) output, dropping LaTeX, and disabling some Sphinx extensions when building for CI (GDScript lexing, creating a search index, and generating HTML description tags).

In my tests, this improves Travis CI build times: from up to 30 minutes down to 2 minutes.
  • Loading branch information
mhilbrunner committed Jun 3, 2020
1 parent 053e935 commit e596fc8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 13 deletions.
21 changes: 11 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
os: linux
dist: bionic
language: python
language: python - "3.8"

python:
- "3.8"

stages:
- build
env:
global:
- SPHINX_NO_GDSCRIPT=1
- SPHINX_NO_SEARCH=1
- SPHINX_NO_DESCRIPTIONS=1

matrix:
include:
Expand All @@ -18,16 +18,17 @@ matrix:
packages:
- dos2unix
- recode
- texlive-full

install:
- pip install -r requirements.txt
- pip install codespell

script:
- bash ./format.sh

# Check for possible typos
- pip install codespell
- codespell -I codespell-ignore.txt {about,community,development,getting_started,tutorials}/**/*.rst

- pip install -r requirements.txt
# TODO: Add `-W` to turn warnings into errors.
# This can only be done once all warnings have been fixed.
- sphinx-build --color -b html -d _build/doctrees . _build/html
- sphinx-build --color -b dummy -d _build/doctrees . _build/html
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ help:
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
@echo " dummy to run only the parse steps without generating output"

clean:
rm -rf $(BUILDDIR)/*
Expand Down Expand Up @@ -195,3 +196,8 @@ pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

dummy:
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. No output."
17 changes: 14 additions & 3 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,24 @@
# Sphinx extension module names and templates location
sys.path.append(os.path.abspath("_extensions"))
extensions = [
"gdscript",
"godot_descriptions",
"sphinx_search.extension",
"sphinx_tabs.tabs",
"sphinx.ext.imgmath",
]

# Warning when the Sphinx Tabs extension is used with unknown
# builders (like the dummy builder) - as it doesn't cause errors,
# we can ignore this so we still can treat other warnings as errors.
sphinx_tabs_nowarn = True

if not os.getenv("SPHINX_NO_GDSCRIPT"):
extensions.append("gdscript")

if not os.getenv("SPHINX_NO_SEARCH"):
extensions.append("sphinx_search.extension")

if not os.getenv("SPHINX_NO_DESCRIPTIONS"):
extensions.append("godot_descriptions")

templates_path = ["_templates"]

# You can specify multiple suffix as a list of string: ['.rst', '.md']
Expand Down

0 comments on commit e596fc8

Please sign in to comment.