From b72d0964dd33b9084a0fc02d7fb365850c5606c6 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Wed, 6 Mar 2019 13:36:22 +0000 Subject: Add Travis CI (#15) * Add and enable Travis CI builds * Add build status to readme --- .travis-ci.sh | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .travis-ci.sh (limited to '.travis-ci.sh') diff --git a/.travis-ci.sh b/.travis-ci.sh new file mode 100644 index 0000000..b3e0744 --- /dev/null +++ b/.travis-ci.sh @@ -0,0 +1,79 @@ +#!/bin/bash + +# This script is triggered from the script section of .travis.yml +# It runs the appropriate commands depending on the task requested. + +set -e + +COVERITY_SCAN_BUILD_URL="https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh" + +SPELLINGBLACKLIST=$(cat <<-BLACKLIST + -wholename "./.git/*" +BLACKLIST +) + +if [[ $TASK = 'spellintian' ]]; then + # run spellintian only if it is the requested task, ignoring duplicate words + spellingfiles=$(eval "find ./ -type f -and ! \( \ + $SPELLINGBLACKLIST \ + \) | xargs") + # count the number of spellintian errors, ignoring duplicate words + spellingerrors=$(zrun spellintian $spellingfiles 2>&1 | grep -v "\(duplicate word\)" | wc -l) + if [[ $spellingerrors -ne 0 ]]; then + # print the output for info + zrun spellintian $spellingfiles | grep -v "\(duplicate word\)" + echo "Found $spellingerrors spelling errors via spellintian, ignoring duplicates" + exit 1; + else + echo "Found $spellingerrors spelling errors via spellintian, ignoring duplicates" + fi; +elif [[ $TASK = 'spellintian-duplicates' ]]; then + # run spellintian only if it is the requested task + spellingfiles=$(eval "find ./ -type f -and ! \( \ + $SPELLINGBLACKLIST \ + \) | xargs") + # count the number of spellintian errors + spellingerrors=$(zrun spellintian $spellingfiles 2>&1 | wc -l) + if [[ $spellingerrors -ne 0 ]]; then + # print the output for info + zrun spellintian $spellingfiles + echo "Found $spellingerrors spelling errors via spellintian" + exit 1; + else + echo "Found $spellingerrors spelling errors via spellintian" + fi; +elif [[ $TASK = 'codespell' ]]; then + # run codespell only if it is the requested task + spellingfiles=$(eval "find ./ -type f -and ! \( \ + $SPELLINGBLACKLIST \ + \) | xargs") + # count the number of codespell errors + spellingerrors=$(zrun codespell --check-filenames --check-hidden --quiet 2 --regex "[a-zA-Z0-9][\\-'a-zA-Z0-9]+[a-zA-Z0-9]" $spellingfiles 2>&1 | wc -l) + if [[ $spellingerrors -ne 0 ]]; then + # print the output for info + zrun codespell --check-filenames --check-hidden --quiet 2 --regex "[a-zA-Z0-9][\\-'a-zA-Z0-9]+[a-zA-Z0-9]" $spellingfiles + echo "Found $spellingerrors spelling errors via codespell" + exit 1; + else + echo "Found $spellingerrors spelling errors via codespell" + fi; +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_ + # variables set in .travis.yml + if [[ ${#COVERITY_SCAN_TOKEN} -ne 0 ]]; then + curl -s $COVERITY_SCAN_BUILD_URL | bash + else + echo "Skipping Coverity Scan as no token found, probably a Pull Request" + fi; +elif [[ $TASK = 'sanitize' ]]; then + # Run sanitized compile + travis_fold start "make_sanitize" + make sanitize; + travis_fold end "make_sanitize" +else + # Otherwise compile as normal + travis_fold start "make" + make; + travis_fold end "make" +fi -- cgit v1.2.3 From c7593145d9d71733ea6a0b32bcd52dd21b3242b8 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 26 Mar 2019 00:32:23 +0000 Subject: Actually build the OLA plugin --- .travis-ci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.travis-ci.sh') diff --git a/.travis-ci.sh b/.travis-ci.sh index b3e0744..ddfa93d 100644 --- a/.travis-ci.sh +++ b/.travis-ci.sh @@ -74,6 +74,6 @@ elif [[ $TASK = 'sanitize' ]]; then else # Otherwise compile as normal travis_fold start "make" - make; + make full; travis_fold end "make" fi -- cgit v1.2.3 From 69f3115df4ff60fdef28408eb89d1b505633fcb4 Mon Sep 17 00:00:00 2001 From: cbdev Date: Tue, 17 Sep 2019 22:17:43 +0200 Subject: Add windows build to CI --- .travis-ci.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to '.travis-ci.sh') diff --git a/.travis-ci.sh b/.travis-ci.sh index ddfa93d..da36c17 100644 --- a/.travis-ci.sh +++ b/.travis-ci.sh @@ -71,6 +71,11 @@ elif [[ $TASK = 'sanitize' ]]; then travis_fold start "make_sanitize" make sanitize; travis_fold end "make_sanitize" +elif [[ $TASK = 'windows' ]]; then + # Run sanitized compile + travis_fold start "make_windows" + make windows; + travis_fold end "make_windows" else # Otherwise compile as normal travis_fold start "make" -- cgit v1.2.3