diff options
author | Clifford Wolf <clifford@clifford.at> | 2017-11-24 06:49:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-24 06:49:15 +0100 |
commit | 203c2dae3cdd255956d5db23d28f241eeca21612 (patch) | |
tree | 0d3dd5b389d9ac774bb5ba2b0defe622c1df4c00 /.travis/setup.sh | |
parent | 494a6f79492d871adae7af10d3d173454b3ecb21 (diff) | |
parent | bc8d40aa88bd784bb19261530ddd29aeeafba815 (diff) | |
download | yosys-203c2dae3cdd255956d5db23d28f241eeca21612.tar.gz yosys-203c2dae3cdd255956d5db23d28f241eeca21612.tar.bz2 yosys-203c2dae3cdd255956d5db23d28f241eeca21612.zip |
Merge pull request #446 from mithro/travis-rework
Reworking the Travis CI for Yosys.
Diffstat (limited to '.travis/setup.sh')
-rwxr-xr-x | .travis/setup.sh | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/.travis/setup.sh b/.travis/setup.sh new file mode 100755 index 000000000..23bdf563f --- /dev/null +++ b/.travis/setup.sh @@ -0,0 +1,89 @@ +#! /bin/bash + +set -e + +source .travis/common.sh + +########################################################################## + +# Fixing Travis's git clone +echo +echo 'Fixing git setup...' && echo -en 'travis_fold:start:before_install.git\\r' +echo +git fetch --unshallow && git fetch --tags + +# For pull requests, we get more info about the git source. +if [ z"$TRAVIS_PULL_REQUEST_SLUG" != z ]; then + echo "- Fetching from pull request source" + git remote add source https://github.com/$TRAVIS_PULL_REQUEST_SLUG.git + git fetch source && git fetch --tags + + echo "- Fetching the actual pull request" + git fetch origin pull/$TRAVIS_PULL_REQUEST/head:pull-$TRAVIS_PULL_REQUEST-head + git fetch origin pull/$TRAVIS_PULL_REQUEST/merge:pull-$TRAVIS_PULL_REQUEST-merge + + git log -n 5 --graph pull-$TRAVIS_PULL_REQUEST-merge +fi + +# For building branches we need to fix the "detached head" state. +if [ z"$TRAVIS_BRANCH" != z ]; then + TRAVIS_COMMIT_ACTUAL=$(git log --pretty=format:'%H' -n 1) + echo "- Fixing detached head (current $TRAVIS_COMMIT_ACTUAL -> $TRAVIS_COMMIT)" + git fetch origin $TRAVIS_COMMIT + git branch -v + git branch -D $TRAVIS_BRANCH || true + git checkout $TRAVIS_COMMIT -b $TRAVIS_BRANCH + git branch -v +fi + +# Output status information. +git status +git describe --tags +git log -n 5 --graph +echo +echo -en 'travis_fold:end:before_install.git\\r' +echo + +########################################################################## + +# Mac OS X specific setup. +if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + ( + echo + echo 'Setting up brew...' && echo -en 'travis_fold:start:before_install.brew\\r' + echo + brew update + brew tap Homebrew/bundle + brew bundle + brew install ccache + brew install gcc + echo + echo -en 'travis_fold:end:before_install.brew\\r' + echo + ) +fi + +########################################################################## + +# Install iverilog +( + if [ ! -e ~/.local-bin/bin/iverilog ]; then + echo + echo 'Building iverilog...' && echo -en 'travis_fold:start:before_install.iverilog\\r' + echo + mkdir -p ~/.local-src + mkdir -p ~/.local-bin + cd ~/.local-src + git clone git://github.com/steveicarus/iverilog.git + cd iverilog + autoconf + ./configure --prefix=$HOME/.local-bin + make + make install + echo + echo -en 'travis_fold:end:before_install.iverilog\\r' + echo + fi +) + +########################################################################## |