forked from easybuilders/easybuild-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
92 lines (92 loc) · 4.81 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
language: python
python: 2.6
env:
matrix:
# purposely specifying slowest builds first, to gain time overall
- LMOD_VERSION=5.8
- LMOD_VERSION=5.8 TEST_EASYBUILD_MODULE_SYNTAX=Tcl
- LMOD_VERSION=6.6.3
- LMOD_VERSION=6.6.3 TEST_EASYBUILD_MODULE_SYNTAX=Tcl
- LMOD_VERSION=7.1
- LMOD_VERSION=7.1 TEST_EASYBUILD_MODULE_SYNTAX=Tcl
- ENV_MOD_VERSION=3.2.10 TEST_EASYBUILD_MODULES_TOOL=EnvironmentModulesC TEST_EASYBUILD_MODULE_SYNTAX=Tcl
- ENV_MOD_TCL_VERSION=1.147 TEST_EASYBUILD_MODULES_TOOL=EnvironmentModulesTcl TEST_EASYBUILD_MODULE_SYNTAX=Tcl
matrix:
# mark build as finished as soon as job has failed
fast_finish: true
include:
# also test default configuration with Python 2.7
- python: 2.7
env: LMOD_VERSION=5.8
addons:
apt:
packages:
# for environment modules/Lmod
- tcl8.5
# for EasyBuild
- python-setuptools
# for GitPython, python-hglib
- git
- mercurial
# for GC3Pie (optional dep for EasyBuild)
- time
before_install:
- pip --version
- pip install --upgrade pip
- pip --version
# keyring is required to provide GitHub token to EasyBuild;
# keyring v5.7.1 is last version to be compatible with py2.6;
# for recent versions of keyring, keyrings.alt must be installed too
- if [ "x$TRAVIS_PYTHON_VERSION" == 'x2.6' ]; then pip install keyring==5.7.1; else pip install 'keyring<=9.1' keyrings.alt; fi
# GitPython 2.x may no longer be compatible with py2.6
- if [ "x$TRAVIS_PYTHON_VERSION" == 'x2.6' ]; then pip install 'GitPython<2.0'; else pip install GitPython; fi
# pydot (dep for python-graph-dot) 1.2.0 and more recent doesn't work with Python 2.6
- if [ "x$TRAVIS_PYTHON_VERSION" == 'x2.6' ]; then pip install pydot==1.1.0; else pip install pydot; fi
# optional Python packages for EasyBuild
- pip install autopep8 GC3Pie pep8 python-graph-dot python-hglib PyYAML
# git config is required to make actual git commits (cfr. tests for GitRepository)
- git config --global user.name "Travis CI"
- git config --global user.email "travis@travis-ci.org"
install:
# install vsc-base (& vsc-install) dependencies for EasyBuild
- easy_install vsc-base
# install environment modules or Lmod
- export INSTALL_DEP=$TRAVIS_BUILD_DIR/easybuild/scripts/install_eb_dep.sh
- if [ ! -z $ENV_MOD_VERSION ]; then source $INSTALL_DEP modules-${ENV_MOD_VERSION} $HOME; fi
- if [ ! -z $LMOD_VERSION ]; then source $INSTALL_DEP lua-5.1.4.8 $HOME; fi
- if [ ! -z $LMOD_VERSION ]; then source $INSTALL_DEP Lmod-${LMOD_VERSION} $HOME; fi
- if [ ! -z $ENV_MOD_TCL_VERSION ]; then source $INSTALL_DEP modules-tcl-${ENV_MOD_TCL_VERSION} $HOME; fi
script:
# make sure 'ml' alias is defined, otherwise sourcing the init script fails (silently) for Lmod (< 5.9.3)
- if [ ! -z $MOD_INIT ] && [ ! -z $LMOD_VERSION ]; then alias ml=foobar; fi
# set up environment for modules tool (if $MOD_INIT is defined)
- if [ ! -z $MOD_INIT ]; then source $MOD_INIT; fi
# install GitHub token
- if [ ! -z $GITHUB_TOKEN ]; then
if [ "x$TRAVIS_PYTHON_VERSION" == 'x2.6' ];
then SET_KEYRING="keyring.set_keyring(keyring.backends.file.PlaintextKeyring())";
else SET_KEYRING="import keyrings; keyring.set_keyring(keyrings.alt.file.PlaintextKeyring())";
fi;
python -c "import keyring; $SET_KEYRING; keyring.set_password('github_token', 'easybuild_test', '$GITHUB_TOKEN')";
fi
# create 'source distribution' tarball, like we do when publishing a release to PyPI
- cd $TRAVIS_BUILD_DIR; python setup.py sdist
- ls -l $TRAVIS_BUILD_DIR/dist/
# set up environment for EasyBuild framework tests
- export PATH=/tmp/$TRAVIS_JOB_ID/bin:$PATH
- export PYTHONPATH=/tmp/$TRAVIS_JOB_ID/lib/python$TRAVIS_PYTHON_VERSION/site-packages
# install easybuild-framework to unique temporary location using prepared sdist tarball
- mkdir -p $PYTHONPATH; easy_install --prefix /tmp/$TRAVIS_JOB_ID $TRAVIS_BUILD_DIR/dist/easybuild-framework*tar.gz
# move outside of checkout of easybuild-framework repository,
# to run tests on an *installed* version of the EasyBuild framework;
# this is done to catch possible packaging issues
- cd $HOME
# run test suite
- python -O -m test.framework.suite
# test bootstrap script
- python $TRAVIS_BUILD_DIR/easybuild/scripts/bootstrap_eb.py /tmp/$TRAVIS_JOB_ID/eb_bootstrap
# unset $PYTHONPATH to avoid mixing two EasyBuild 'installations' when testing bootstrapped EasyBuild module
- unset PYTHONPATH
# simply sanity check on bootstrapped EasyBuild module
# note: temporarily disabled because bootstrap test fails, cfr. https://github.com/hpcugent/easybuild-framework/issues/1869
- module use /tmp/$TRAVIS_JOB_ID/eb_bootstrap/modules/all; module load EasyBuild; eb --version