From 5c46e4aabfa8a3392dd4814ab91bdc74be7f4c40 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Wed, 10 Apr 2019 15:24:37 +0800 Subject: [PATCH] add missing files for Travis --- .travis/after_failure.sh | 12 +++++++++++ .travis/after_success.sh | 8 ++++++++ .travis/common.sh | 43 ++++++++++++++++++++++++++++++++++++++++ .travis/install.sh | 16 +++++++++++++++ .travis/script.sh | 19 ++++++++++++++++++ 5 files changed, 98 insertions(+) create mode 100755 .travis/after_failure.sh create mode 100755 .travis/after_success.sh create mode 100644 .travis/common.sh create mode 100755 .travis/install.sh create mode 100755 .travis/script.sh diff --git a/.travis/after_failure.sh b/.travis/after_failure.sh new file mode 100755 index 000000000..95f8bd80c --- /dev/null +++ b/.travis/after_failure.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +source .travis/common.sh +set -e + +# Close the after_success.1 fold travis has created already. +travis_time_finish +travis_fold end after_failure.1 + +start_section "failure.tail" "${RED}Failure output...${NC}" +tail -n 1000 output.log +end_section "failure.tail" diff --git a/.travis/after_success.sh b/.travis/after_success.sh new file mode 100755 index 000000000..7cab5b2b4 --- /dev/null +++ b/.travis/after_success.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +source .travis/common.sh +set -e + +# Close the after_success fold travis has created already. +travis_fold end after_success + diff --git a/.travis/common.sh b/.travis/common.sh new file mode 100644 index 000000000..24c38b1f7 --- /dev/null +++ b/.travis/common.sh @@ -0,0 +1,43 @@ +# Some colors, use it like following; +# echo -e "Hello ${YELLOW}yellow${NC}" +GRAY='\033[0;30m' +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +PURPLE='\033[0;35m' +NC='\033[0m' # No Color + +SPACER="echo -e ${GRAY} - ${NC}" + +export -f travis_nanoseconds +export -f travis_fold +export -f travis_time_start +export -f travis_time_finish + +function start_section() { + travis_fold start "$1" + travis_time_start + echo -e "${PURPLE}OpenFPGA${NC}: - $2${NC}" + echo -e "${GRAY}-------------------------------------------------------------------${NC}" +} + +function end_section() { + echo -e "${GRAY}-------------------------------------------------------------------${NC}" + travis_time_finish + travis_fold end "$1" +} + +# For Mac OS, we use g++-8 and gcc-8 as default compilers +if [[ $TRAVIS_OS_NAME == 'osx' ]]; then + export CC=gcc-8 + export CXX=g++-8 + # export PATH="/usr/local/opt/bison/bin:/usr/local/bin:$PATH" + # export PATH="/usr/local/opt/qt/bin:$PATH" + # Install header files in Mojave, if not gcc-4.9 cannot spot stdio.h + sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / +else + # For linux, we use g++-6 and gcc-6 as default compilers + #export CC=gcc + #export CXX=g++ +fi + diff --git a/.travis/install.sh b/.travis/install.sh new file mode 100755 index 000000000..16f848403 --- /dev/null +++ b/.travis/install.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +source .travis/common.sh +set -e + +# Git repo fixup +#start_section "environment.git" "Setting up ${YELLOW}git checkout${NC}" +#set -x +#git fetch --tags +#git submodule update --recursive --init +#git submodule foreach git submodule update --recursive --init +#set +x +#end_section "environment.git" + +$SPACER + diff --git a/.travis/script.sh b/.travis/script.sh new file mode 100755 index 000000000..06503b5e7 --- /dev/null +++ b/.travis/script.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +source .travis/common.sh +set -e + +$SPACER + +start_section "OpenFPGA.build" "${GREEN}Building..${NC}" +if [[ $TRAVIS_OS_NAME == 'osx' ]]; then + make -j2 +else +# For linux, we enable full package compilation + make -j8 +fi +end_section "OpenFPGA.build" + +$SPACER + +