more robust and cache-friendly Linux Travis CI

This commit is contained in:
Zachary Snow 2019-04-17 21:27:06 -04:00
parent 96e0aff7f4
commit f3e8f530d9
1 changed files with 24 additions and 15 deletions

View File

@ -10,7 +10,7 @@ matrix:
cache: cache:
directories: directories:
- $HOME/.stack - $HOME/.stack
- $HOME/iverilog - $HOME/.local
addons: addons:
apt: apt:
@ -21,6 +21,8 @@ addons:
# for iverilog # for iverilog
- flex - flex
- bison - bison
- autoconf
- gperf
homebrew: homebrew:
packages: packages:
- haskell-stack - haskell-stack
@ -31,25 +33,32 @@ before_install:
- | - |
set -ex set -ex
if [ "$TRAVIS_OS_NAME" == "linux" ]; then if [ "$TRAVIS_OS_NAME" == "linux" ]; then
# install the latest version of stack orig_pwd=$PWD
# based on: https://raw.githubusercontent.com/commercialhaskell/stack/stable/doc/travis-simple.yml
mkdir -p ~/.local/bin mkdir -p ~/.local/bin
export PATH=$HOME/.local/bin:$PATH export PATH=$HOME/.local/bin:$PATH
travis_retry curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' # install the latest version of stack
# install iverilog 10.2 if [ ! -e "$HOME/.local/bin/stack" ]; then
if [ ! -e "iverilog/verilog-10.2" ]; then # based on: https://raw.githubusercontent.com/commercialhaskell/stack/stable/doc/travis-simple.yml
mkdir -p iverilog travis_retry curl --retry-max-time 60 -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz > stack.tar.gz
cd iverilog tar -xzf stack.tar.gz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
travis_retry curl -L ftp://icarus.com/pub/eda/verilog/v10/verilog-10.2.tar.gz > verilog-10.2.tar.gz
tar -xzf verilog-10.2.tar.gz
cd verilog-10.2
./configure
make
cd ../..
fi fi
(cd iverilog/verilog-10.2 && sudo make install) # install iverilog 10.2
if [ ! -e "$HOME/.local/bin/iverilog" ]; then
travis_retry curl --retry-max-time 60 -L https://github.com/steveicarus/iverilog/archive/v10_2.tar.gz > v10_2.tar.gz
tar -xzf v10_2.tar.gz
cd iverilog-10_2
autoconf
./configure --prefix=$HOME/.local
make
make install
cd ..
fi
cd $orig_pwd
fi fi
set +ex set +ex
- which stack iverilog shunit2
- stack --numeric-version
- iverilog -V 2> /dev/null | head -n 1
install: install:
make make