Skip to content

Commit

Permalink
Merge pull request #1499 from peternewman/0.10-libftdi1
Browse files Browse the repository at this point in the history
Add some Travis folding
  • Loading branch information
peternewman committed Oct 16, 2018
2 parents 30ea4d2 + f33ca99 commit 9aa9e9b
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 8 deletions.
76 changes: 68 additions & 8 deletions .travis-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ BLACKLIST

if [[ $TASK = 'lint' ]]; then
# run the lint tool only if it is the requested task
travis_fold start "autoreconf"
autoreconf -i;
travis_fold end "autoreconf"
./configure --enable-rdm-tests --enable-ja-rule --enable-e133;
# the following is a bit of a hack to build the files normally built during
# the build, so they are present for linting to run against
make builtfiles
travis_fold start "make_builtfiles"
make builtfiles;
travis_fold end "make_builtfiles"
# first check we've not got any generic NOLINTs
# count the number of generic NOLINTs
nolints=$(grep -IR NOLINT * | grep -v "NOLINT(" | wc -l)
Expand Down Expand Up @@ -80,22 +84,34 @@ if [[ $TASK = 'lint' ]]; then
fi;
elif [[ $TASK = 'check-licences' ]]; then
# check licences only if it is the requested task
travis_fold start "autoreconf"
autoreconf -i;
travis_fold end "autoreconf"
travis_fold start "configure"
./configure --enable-rdm-tests --enable-ja-rule --enable-e133;
travis_fold end "configure"
# the following is a bit of a hack to build the files normally built during
# the build, so they are present for licence checking to run against
make builtfiles
travis_fold start "make_builtfiles"
make builtfiles;
travis_fold end "make_builtfiles"
./scripts/enforce_licence.py
if [[ $? -ne 0 ]]; then
exit 1;
fi;
elif [[ $TASK = 'spellintian' ]]; then
# run spellintian only if it is the requested task, ignoring duplicate words
travis_fold start "autoreconf"
autoreconf -i;
travis_fold end "autoreconf"
travis_fold start "configure"
./configure --enable-rdm-tests --enable-ja-rule --enable-e133;
travis_fold end "configure"
# the following is a bit of a hack to build the files normally built during
# the build, so they are present for spellintian to run against
make builtfiles
travis_fold start "make_builtfiles"
make builtfiles;
travis_fold end "make_builtfiles"
spellingfiles=$(eval "find ./ -type f -and ! \( \
$SPELLINGBLACKLIST \
\) | xargs")
Expand All @@ -111,11 +127,17 @@ elif [[ $TASK = 'spellintian' ]]; then
fi;
elif [[ $TASK = 'spellintian-duplicates' ]]; then
# run spellintian only if it is the requested task
travis_fold start "autoreconf"
autoreconf -i;
travis_fold end "autoreconf"
travis_fold start "configure"
./configure --enable-rdm-tests --enable-ja-rule --enable-e133;
travis_fold end "configure"
# the following is a bit of a hack to build the files normally built during
# the build, so they are present for spellintian to run against
make builtfiles
travis_fold start "make_builtfiles"
make builtfiles;
travis_fold end "make_builtfiles"
spellingfiles=$(eval "find ./ -type f -and ! \( \
$SPELLINGBLACKLIST \
\) | xargs")
Expand All @@ -131,11 +153,17 @@ elif [[ $TASK = 'spellintian-duplicates' ]]; then
fi;
elif [[ $TASK = 'codespell' ]]; then
# run codespell only if it is the requested task
travis_fold start "autoreconf"
autoreconf -i;
travis_fold end "autoreconf"
travis_fold start "configure"
./configure --enable-rdm-tests --enable-ja-rule --enable-e133;
travis_fold end "configure"
# the following is a bit of a hack to build the files normally built during
# the build, so they are present for codespell to run against
make builtfiles
travis_fold start "make_builtfiles"
make builtfiles;
travis_fold end "make_builtfiles"
spellingfiles=$(eval "find ./ -type f -and ! \( \
$SPELLINGBLACKLIST \
\) | xargs")
Expand All @@ -151,12 +179,18 @@ elif [[ $TASK = 'codespell' ]]; then
fi;
elif [[ $TASK = 'doxygen' ]]; then
# check doxygen only if it is the requested task
travis_fold start "autoreconf"
autoreconf -i;
travis_fold end "autoreconf"
# Doxygen is C++ only, so don't bother with RDM tests
travis_fold start "configure"
./configure --enable-ja-rule --enable-e133;
travis_fold end "configure"
# the following is a bit of a hack to build the files normally built during
# the build, so they are present for Doxygen to run against
make builtfiles
travis_fold start "make_builtfiles"
make builtfiles;
travis_fold end "make_builtfiles"
# count the number of warnings
warnings=$(make doxygen-doc 2>&1 >/dev/null | wc -l)
if [[ $warnings -ne 0 ]]; then
Expand All @@ -169,11 +203,19 @@ elif [[ $TASK = 'doxygen' ]]; then
fi;
elif [[ $TASK = 'coverage' ]]; then
# Compile with coverage for coveralls
travis_fold start "autoreconf"
autoreconf -i;
travis_fold end "autoreconf"
# Coverage is C++ only, so don't bother with RDM tests
travis_fold start "configure"
./configure --enable-gcov --enable-ja-rule --enable-e133;
travis_fold end "configure"
travis_fold start "make"
make;
travis_fold end "make"
travis_fold start "make_check"
make check;
travis_fold end "make_check"
elif [[ $TASK = 'coverity' ]]; then
# Run Coverity Scan unless token is zero length
# The Coverity Scan script also relies on a number of other COVERITY_SCAN_
Expand All @@ -185,24 +227,42 @@ elif [[ $TASK = 'coverity' ]]; then
fi;
elif [[ $TASK = 'jshint' ]]; then
cd ./javascript/new-src;
travis_fold start "npm_install"
npm install;
travis_fold end "npm_install"
grunt test
elif [[ $TASK = 'flake8' ]]; then
travis_fold start "autoreconf"
autoreconf -i;
./configure --enable-rdm-tests
travis_fold end "autoreconf"
travis_fold start "configure"
./configure --enable-rdm-tests;
travis_fold end "configure"
# the following is a bit of a hack to build the files normally built during
# the build, so they are present for flake8 to run against
make builtfiles
travis_fold start "make_builtfiles"
make builtfiles;
travis_fold end "make_builtfiles"
flake8 --max-line-length 80 --exclude *_pb2.py,.git,__pycache --ignore E111,E114,E121,E127,E129 data/rdm include/ola python scripts tools/ola_mon tools/rdm
else
# Otherwise compile and check as normal
export DISTCHECK_CONFIGURE_FLAGS='--enable-rdm-tests --enable-ja-rule --enable-e133'
travis_fold start "autoreconf"
autoreconf -i;
travis_fold end "autoreconf"
travis_fold start "configure"
./configure $DISTCHECK_CONFIGURE_FLAGS;
travis_fold end "configure"
travis_fold start "make_distcheck"
make distcheck;
travis_fold end "make_distcheck"
travis_fold start "make_dist"
make dist;
travis_fold end "make_dist"
travis_fold start "verify_trees"
tarball=$(ls -Ut ola*.tar.gz | head -1)
tar -zxf $tarball;
tarball_root=$(echo $tarball | sed 's/.tar.gz$//')
./scripts/verify_trees.py ./ $tarball_root
travis_fold end "verify_trees"
fi
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ language: cpp
sudo: required
# Use the latest Travis images since they are more up to date than the stable release.
group: edge

before_script:
- export -f travis_fold

script:
- "bash -ex .travis-ci.sh"

Expand Down

0 comments on commit 9aa9e9b

Please sign in to comment.