Skip to content

Instantly share code, notes, and snippets.

@mustafa-travisci
Created July 21, 2020 12:38
Show Gist options
  • Save mustafa-travisci/364a44483dd8aae9df934e8a79df8e9e to your computer and use it in GitHub Desktop.
Save mustafa-travisci/364a44483dd8aae9df934e8a79df8e9e to your computer and use it in GitHub Desktop.
Correction on .travis.yml file.
# .travis.yaml
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# NEST is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with NEST. If not, see <http://www.gnu.org/licenses/>.
# This is the Travis CI top-level script to setup and run the NEST
# build and test environment.
language: python
#cache: pip
#cache: ccache
# Using the Sudo-enabled Ubuntu Bionic (18.04 LTS).
sudo: required
dist: bionic
env:
global:
- MAKEFLAGS="-j 2"
stages:
- Staticcheck
- MPI-Threading-GSL-Python
- Python-Full-build-Clang7-OsX
- ARM64
# list of build stages to run. Stages with the same name get run in parallel.
jobs:
include:
- stage: Staticcheck
python: 3.6.10
env: xTHREADING=0 xMPI=0 xSIONLIB=0 xGSL=0 xLIBNEUROSIM=0 xLTDL=0 xREADLINE=0 xLIBBOOST=0 xPYTHON=0 xMUSIC=0 xSTATIC_ANALYSIS=1 xRUN_BUILD_AND_TESTSUITE=0 CACHE_NAME=JOB # only static code analysis
- stage: MPI-Threading-GSL-Python
python: 3.6.10
env: xTHREADING=1 xMPI=1 xSIONLIB=0 xGSL=1 xLIBNEUROSIM=0 xLTDL=1 xREADLINE=1 xLIBBOOST=1 xPYTHON=1 xMUSIC=0 xSTATIC_ANALYSIS=0 xRUN_BUILD_AND_TESTSUITE=1 CACHE_NAME=JOB
- stage: MPI-Threading-GSL-Python
python: 3.6.10
env: xTHREADING=0 xMPI=1 xSIONLIB=0 xGSL=0 xLIBNEUROSIM=0 xLTDL=1 xREADLINE=1 xLIBBOOST=1 xPYTHON=0 xMUSIC=0 xSTATIC_ANALYSIS=0 xRUN_BUILD_AND_TESTSUITE=1 CACHE_NAME=JOB # only MPI
- stage: MPI-Threading-GSL-Python
python: 3.6.10
env: xTHREADING=1 xMPI=0 xSIONLIB=0 xGSL=0 xLIBNEUROSIM=0 xLTDL=1 xREADLINE=1 xLIBBOOST=1 xPYTHON=0 xMUSIC=0 xSTATIC_ANALYSIS=0 xRUN_BUILD_AND_TESTSUITE=1 CACHE_NAME=JOB # only threading
- stage: MPI-Threading-GSL-Python
python: 3.6.10
env: xTHREADING=0 xMPI=0 xSIONLIB=0 xGSL=0 xLIBNEUROSIM=0 xLTDL=0 xREADLINE=0 xLIBBOOST=0 xPYTHON=1 xMUSIC=0 xSTATIC_ANALYSIS=0 xRUN_BUILD_AND_TESTSUITE=1 CACHE_NAME=JOB # Only Python
- stage: Python-Full-build-Clang7-OsX
python: 3.6.10
env: xTHREADING=1 xMPI=1 xSIONLIB=1 xGSL=1 xLIBNEUROSIM=1 xLTDL=1 xREADLINE=1 xLIBBOOST=1 xPYTHON=1 xMUSIC=1 xSTATIC_ANALYSIS=0 xRUN_BUILD_AND_TESTSUITE=1 CACHE_NAME=JOB # full
- stage: Python-Full-build-Clang7-OsX
language: cpp
python: 3.6.10
env: MATRIX_EVAL="CC=clang-7 && CXX=clang++-7" xRUN_BUILD_AND_TESTSUITE=1
- stage: Python-Full-build-Clang7-OsX
os: osx
osx_image: xcode12 # Python 3.8.3 running on macOS 10.15.5
language: shell # language 'python' results in errors on macOS
cache: ccache
env: xTHREADING=1 xMPI=0 xGSL=1 xLIBNEUROSIM=0 xLTDL=1 xREADLINE=1 xPYTHON=1 xMUSIC=0 xSTATIC_ANALYSIS=0 xRUN_BUILD_AND_TESTSUITE=1 CACHE_NAME=JOB # Without MUSIC, MPI and Libneurosim
#https://docs.travis-ci.com/user/installing-dependencies#Installing-Packages-with-the-APT-Addon
addons:
apt:
sources:
- *BASE_SOURCES
- r-packages-bionic
- ubuntu-toolchain-r-test
- llvm-toolchain-bionic-9
packages:
- *BASE_PACKAGES
- gcc-8
- g++-8
- clang-7
- build-essential
- cmake
- libltdl-dev
- libreadline6-dev
- libncurses5-dev
- libgsl0-dev
- python3-all-dev
- ipython3
- pkg-config
- openmpi-bin
- libopenmpi-dev
- libpcre3
- libpcre3-dev
- llvm-9-dev
- jq
- pep8
- libboost-filesystem-dev
- libboost-regex-dev
- libboost-wave-dev
- libboost-python-dev
- libboost-program-options-dev
- libboost-test-dev
- python3-mpi4py
#cache:
# directory:
# - $HOME/.cache
before_install:
- export SOURCEDIR=$PWD
# select the right C++ compiler version (gcc8) -- note that update-alternatives is not available on MacOS
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
ls -lh /usr/bin/g++*
ls -lh /usr/bin/gcc*
ls -lh /usr/bin/c++*
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 10
sudo update-alternatives --auto g++
sudo update-alternatives --list g++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 20
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 10
sudo update-alternatives --auto gcc
sudo update-alternatives --list gcc
sudo update-alternatives --list c++
sudo update-alternatives --auto c++
g++ --version
/usr/bin/c++ --version
fi
- |
if [ "$xRUN_BUILD_AND_TESTSUITE" = "1" ]; then
echo "+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"
echo "+ P R E P A R E N E S T B U I L D E N V I R O N M E N T +"
echo "+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"
echo ${MATRIX_EVAL}
eval "${MATRIX_EVAL}"
cp extras/install_csa-libneurosim.sh $HOME
cp extras/install_music.sh $HOME
cp extras/install_sionlib.sh $HOME
cp extras/install_libboost.sh $HOME
cd $HOME/build
echo $PATH
if [ MATRIX_EVAL="CC=clang-7 && CXX=clang++-7" ]; then
pyenv install --list
pyenv global 3.6.10
fi
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew --version
brew update
brew info python
brew install ccache
export PATH="/usr/local/opt/ccache/libexec:$PATH"
export PATH="/usr/local/opt/python/libexec/bin:$PATH" # To use homebrew's Python
brew tap brewsci/science
brew tap brewsci/bio
brew install coreutils gsl open-mpi automake autoconf libtool
brew unlink gcc
brew install gcc@8
brew link gcc@8
find /usr/local/Cellar/ -name Python\.h
find /usr/local/Cellar/ -name \*python\*dylib
fi
if [ "$TRAVIS_OS_NAME" != "osx" ]; then
# Upgrade pip and setuptools
pip install --upgrade pip setuptools
pip install nose
else
# updating pip breaks on osx, must install man-page free nose
wget https://arken.nmbu.no/~plesser/nose-1.3.7noman-py3-none-any.whl
pip install nose-1.3.7noman-py3-none-any.whl
fi
# Installing additional packages using pip as they only have
# outdated versions in the Travis package whitelist.
# terminaltables is required by parse_travis_log.py to create
# the build summary.
pip install cython scipy matplotlib terminaltables junitparser
pip install numpy==1.16.5
pip list
fi
install:
- |
if [ "$xRUN_BUILD_AND_TESTSUITE" = "1" ]; then
which cython
cython --version
which python
python --version
which pip
pip list
which nosetests
nosetests --version
nosetests --plugins
which cmake
cmake --version
echo ${CC}
echo ${CXX}
fi
before_script:
# Change directory back to the NEST source code directory.
- cd $SOURCEDIR
- chmod +x extras/travis_build.sh
script:
- set -o pipefail
- ./extras/travis_build.sh 2>&1 | tee travis_build.sh.log
- |
if [ "$xRUN_BUILD_AND_TESTSUITE" = "1" ]; then
python extras/parse_travis_log.py travis_build.sh.log ;
fi
before_deploy:
- |
if [ "$xRUN_BUILD_AND_TESTSUITE" = "1" ]; then
cd $TRAVIS_BUILD_DIR/build
tar -zcvf reports.tar.gz ./reports
tar -zcvf docs.tar.gz $TRAVIS_BUILD_DIR/result/share/doc/nest/*.*
mkdir -p $TRAVIS_BUILD_DIR/build/artefacts_upload
mv docs.tar.gz $TRAVIS_BUILD_DIR/build/artefacts_upload
mv reports.tar.gz $TRAVIS_BUILD_DIR/build/artefacts_upload
fi
# S3 Deployment (Uploading the Travis CI build artefacts to Amazon S3).
deploy:
provider: s3
access_key_id:
secure: $ARTIFACTS_KEY
secret_access_key:
secure: $ARTIFACTS_SECRET
bucket: "nest-travis-artefacts"
region: eu-central-1
skip_cleanup: true
on:
repo: nest/nest-simulator
branch: master
condition: xRUN_BUILD_AND_TESTSUITE = 1
local-dir: "$TRAVIS_BUILD_DIR/build/artefacts_upload"
upload-dir: "$TRAVIS_REPO_SLUG/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER"
acl: bucket_owner_full_control
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment