Add a script to make docs in Travis

This also stores the current library sizes (in -Os / -Oz build modes)
for each branch,

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Thiago Macieira
2018-01-30 14:21:35 -08:00
parent 301e263afb
commit 3cdb9c890b
4 changed files with 64 additions and 8 deletions
+13 -7
View File
@@ -10,6 +10,7 @@ matrix:
packages:
- qt59base valgrind
- g++-7
- doxygen
env:
- QMAKESPEC=linux-g++
- EVAL="CC=gcc-7 && CXX=g++-7"
@@ -20,21 +21,24 @@ matrix:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
- sourceline: 'ppa:beineri/opt-qt593-trusty'
packages:
- qt59base
- clang-5.0
env:
- QMAKESPEC=linux-clang
- EVAL="CC=clang-5.0 && CXX=clang++-5.0"
- EVAL="CC=clang-5.0 && CXX=clang++"
- PATH=$PATH:/usr/local/clang/bin
- CFLAGS="-Oz"
- QMAKEFLAGS="-config release"
- MAKEFLAGS=-s
- TESTARGS=-silent
- os: osx
env:
- QMAKESPEC=macx-clang
- CFLAGS="-Oz"
- QMAKEFLAGS="-config debug"
- MAKEFLAGS=-s
- TESTARGS=-silent
- PATH=/usr/local/opt/qt5/bin:$PATH
install:
- if [ "${TRAVIS_OS_NAME}" != "linux" ]; then
@@ -49,12 +53,14 @@ script:
CFLAGS="$CFLAGS -march=native -g1 -Wall -Wextra -Werror"
CPPFLAGS="-DNDEBUG"
lib/libtinycbor.a
- size lib/libtinycbor.a
- make clean
- size lib/libtinycbor.a | tee sizes
- make -s clean
- make -k
CFLAGS="$CFLAGS -O0 -g"
- make
QMAKEFLAGS="$QMAKEFLAGS QMAKE_CXX=$CXX"
tests/Makefile
- cd tests && make check -k
TESTRUNNER=`which valgrind 2>/dev/null`
- (cd tests && make check -k
TESTRUNNER=`which valgrind 2>/dev/null`)
- make -s clean
- ./scripts/update-docs.sh
+1 -1
View File
@@ -209,7 +209,7 @@ distcheck: .git
$(RM) -r $${TMPDIR-/tmp}/tinycbor-distcheck
tag: distcheck
@cd $(SRCDIR). && perl maketag.pl
@cd $(SRCDIR). && perl scripts/maketag.pl
.PHONY: all check silentcheck configure install uninstall
.PHONY: mostlyclean clean distclean
View File
+50
View File
@@ -0,0 +1,50 @@
#!/bin/sh -ex
case "$TRAVIS_BRANCH,$TRAVIS_PULL_REQUEST" in
dev,false|master,false)
;;
*)
exit 0
;;
esac
V=`cut -f1-2 -d. <VERSION`
git fetch origin gh-pages
# Fail if the library sizes file isn't present
test -r sizes
# Run doxygen (maybe)
if [ -n "${TRAVIS_TAG-$FORCE_DOCS}" ] && make -s docs 2>/dev/null; then
git checkout -b gh-pages FETCH_HEAD
if [ -d "$V" ]; then
mv "$V" "old-$V"
fi
mv doc/html "$V"
git add -A "$V"
else
git checkout -b gh-pages FETCH_HEAD
mkdir -p "$V"
fi
# Update the symlink for the branch name
rm -f "./$TRAVIS_BRANCH"
ln -s "$V" "$TRAVIS_BRANCH"
git add "./$TRAVIS_BRANCH"
# Update the library sizes file
# (will fail if the release build failed)
mkdir -p "library_sizes/$TRAVIS_BRANCH"
mv sizes "library_sizes/$TRAVIS_BRANCH/$QMAKESPEC"
(cd "library_sizes/$TRAVIS_BRANCH/";
for f in *; do echo "$f:"; cat "$f" ; done) > "$V/library_sizes.txt"
git add "library_sizes/$TRAVIS_BRANCH" "$V/library_sizes.txt"
# Commit everything
if git commit -m "Update docs for $V (Travis build $TRAVIS_BUILD_NUMBER)
Matching commit $TRAVIS_COMMIT:
$TRAVIS_COMMIT_MESSAGE"; then
# We've made a commit, push it
set +x
url=`git config --get remote.origin.url | sed -e s,://github,://$GITHUB_AUTH@github,`
git push "$url" @:gh-pages
fi