Re: [PATCH v1] travis-ci: build documentation
- From
Lars Schneider <larsxschneider@gmail.com>
- Date
- Apr 25, 2016, 08:17 UTC
- Message-ID
- <E752A0BF-92D9-4BCF-ADD2-94F8E7BD66F2@gmail.com>
- In-Reply-To
- <vpq37qeovu4.fsf@anie.imag.fr>
On 22 Apr 2016, at 11:07, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 6 quoted lines
> larsxschneider@gmail.com writes: > >> + if [[ "$TRAVIS_OS_NAME" = linux ]] && [[ "$CC" = gcc ]]; > > [[ is a bashism, and doesn't bring anything here compared to the POSIX > [ ... ], or "test" which is prefered in Git's source code.
OK! Thanks for the hint.
> The ; or the newline is not needed either.
Unfortunately it seems to be required. Travis CI generates a shell script out of the yml file and I think they don't respect newlines or something...
Show 12 quoted lines
> > I'd write > > if test "$TRAVIS_OS_NAME" = linux && test "$CC" = gcc; then > >> + then >> + echo "" >> + echo "------------------------------------------------------------------------" && > > I usualy avoid "echo <something-starting-with-dash>" as I'm not sure how > portable it is across variants of "echo". Maybe this one is portable > enough, I don't know. Perhaps printf, or cat << EOF ...?
I am curious. Do you have an example on what platform echo "-something" could go wrong? I wasn't aware of such an issue.
Show 6 quoted lines
> >> + echo "$(tput setaf 2)Building documentation...$(tput sgr0)" && >> + make --quiet doc >> + fi; > > Nit: useless ;
Again, seems to be required by the Travis yml converter.
Show 6 quoted lines
> I think it makes sense to do some lightweight checks after "make doc", > rather than just check the return code. For example, check that a few > generated files exist and are non-empty, like > > test -s Documentation/git.html && > test -s Documentation/git.1
Great idea. Added to v2! The && is not necessary as Travis runs this script with "set -e".
Thanks, Lars