add missing files for Travis

This commit is contained in:
tangxifan 2019-04-10 15:24:37 +08:00
parent 8eeb144f32
commit 5c46e4aabf
5 changed files with 98 additions and 0 deletions

12
.travis/after_failure.sh Executable file
View File

@ -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"

8
.travis/after_success.sh Executable file
View File

@ -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

43
.travis/common.sh Normal file
View File

@ -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

16
.travis/install.sh Executable file
View File

@ -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

19
.travis/script.sh Executable file
View File

@ -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