Skip to content

Commit

Permalink
Add documentation checks to be executed in Travis CI
Browse files Browse the repository at this point in the history
- Validate all internal references
- Validate parse errors
- Validate external links

Signed-off-by: Michal Čihař <[email protected]>
  • Loading branch information
nijel committed Oct 18, 2016
1 parent ece3dd0 commit b10e570
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ matrix:
env: CI_MODE=selenium
- php: "7.0"
env: CI_MODE=release
- php: "7.0"
env: CI_MODE=docs
cache:
directories:
- $HOME/.composer/cache/
Expand Down
30 changes: 30 additions & 0 deletions test/ci-docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

set -e

travis_retry() {
local result=0
local count=1
while [ $count -le 3 ]; do
[ $result -ne 0 ] && {
echo -e "\n${ANSI_RED}The command \"$@\" failed. Retrying, $count of 3.${ANSI_RESET}\n" >&2
}
"$@"
result=$?
[ $result -eq 0 ] && break
count=$(($count + 1))
sleep 1
done

[ $count -gt 3 ] && {
echo -e "\n${ANSI_RED}The command \"$@\" failed 3 times.${ANSI_RESET}\n" >&2
}

return $result
}

# Build documentation with warnings treated as errors
make -C doc html SPHINXOPTS='-n -W -a'

# Check external links
travis_retry make -C doc linkcheck
6 changes: 6 additions & 0 deletions test/ci-install-docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

# We use 1.5 to be able to deal with gzip only sites in linkcheck (such as tcpdf.org)

pip install --user 'Sphinx>=1.5a2'

0 comments on commit b10e570

Please sign in to comment.