diff --git a/.travis.yml b/.travis.yml index 7ff7a15982..de8b7dcc73 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,32 +26,18 @@ env: - OPENMC_MULTIPOLE_LIBRARY=$HOME/multipole_lib - PATH=$PATH:$HOME/NJOY2016/build matrix: - - OPENMC_CONFIG="check_source" - OPENMC_CONFIG="^hdf5-debug$" - OPENMC_CONFIG="^omp-hdf5-debug$" - OPENMC_CONFIG="^mpi-hdf5-debug$" - OPENMC_CONFIG="^phdf5-debug$" -# We aren't testing the check_source script so just run it with Python 3. -matrix: - exclude: - - python: "2.7" - env: OPENMC_CONFIG="check_source" - before_install: - - if [[ $OPENMC_CONFIG != "check_source" ]]; then - sudo add-apt-repository ppa:nschloe/hdf5-backports -y; - sudo apt-get update -q; - sudo apt-get install libhdf5-serial-dev libhdf5-mpich-dev -y; - fi + - sudo add-apt-repository ppa:nschloe/hdf5-backports -y + - sudo apt-get update -q + - sudo apt-get install libhdf5-serial-dev libhdf5-mpich-dev -y install: - - if [[ $OPENMC_CONFIG != "check_source" ]]; then - ./tools/ci/travis-install-njoy.sh - pip install numpy cython; - pip install --upgrade pytest; - pip install -e .[test]; - fi + - ./tools/ci/travis-install.sh before_script: - ./tools/ci/travis-before-script.sh diff --git a/tools/ci/travis-before-script.sh b/tools/ci/travis-before-script.sh index 6a56fcfe7c..bbf4980b0f 100755 --- a/tools/ci/travis-before-script.sh +++ b/tools/ci/travis-before-script.sh @@ -1,17 +1,16 @@ #!/bin/bash set -ex -if [[ $OPENMC_CONFIG != "check_source" ]]; then - # Download NNDC HDF5 data - if [[ ! -e $HOME/nndc_hdf5/cross_sections.xml ]]; then - wget https://anl.box.com/shared/static/a6sw2cep34wlz6b9i9jwiotaqoayxcxt.xz -O - | tar -C $HOME -xvJ - fi - # Download ENDF/B-VII.1 distribution - if [[ ! -d $HOME/endf-b-vii.1/neutrons ]]; then - wget https://anl.box.com/shared/static/4kd2gxnf4gtk4w1c8eua5fsua22kvgjb.xz -O - | tar -C $HOME -xvJ - fi - - # Download multipole library - git clone --branch=master git://github.com/smharper/windowed_multipole_library.git wmp_lib - tar -C $HOME -xzvf wmp_lib/multipole_lib.tar.gz +# Download NNDC HDF5 data +if [[ ! -e $HOME/nndc_hdf5/cross_sections.xml ]]; then + wget https://anl.box.com/shared/static/a6sw2cep34wlz6b9i9jwiotaqoayxcxt.xz -O - | tar -C $HOME -xvJ fi + +# Download ENDF/B-VII.1 distribution +if [[ ! -d $HOME/endf-b-vii.1/neutrons ]]; then + wget https://anl.box.com/shared/static/4kd2gxnf4gtk4w1c8eua5fsua22kvgjb.xz -O - | tar -C $HOME -xvJ +fi + +# Download multipole library +git clone --branch=master git://github.com/smharper/windowed_multipole_library.git wmp_lib +tar -C $HOME -xzvf wmp_lib/multipole_lib.tar.gz diff --git a/tools/ci/travis-install.sh b/tools/ci/travis-install.sh new file mode 100755 index 0000000000..354ae7f7f4 --- /dev/null +++ b/tools/ci/travis-install.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -ex + +# Install NJOY 2016 +./tools/ci/travis-install-njoy.sh + +# Running OpenMC's setup.py requires numpy/cython already +pip install numpy cython + +# pytest installed by default -- make sure we get latest +pip install --upgrade pytest + +# Pandas stopped supporting Python 3.4 with version 0.21 +if [[ "$TRAVIS_PYTHON_VERSION" == "3.4" ]]; then + pip install pandas==0.20.3 +fi + +# Install OpenMC in editable mode +pip install -e .[test] diff --git a/tools/ci/travis-script.sh b/tools/ci/travis-script.sh index 71a3c6d746..978a2811c4 100755 --- a/tools/ci/travis-script.sh +++ b/tools/ci/travis-script.sh @@ -1,9 +1,8 @@ #!/bin/bash set -ex cd tests -if [[ $OPENMC_CONFIG == "check_source" ]]; then - ./check_source.py; -else - ./run_tests.py -C $OPENMC_CONFIG -j 2 - pytest --cov=../openmc -v unit_tests/ +if [[ $TRAVIS_PYTHON_VERSION == "3.4" && $OPENMC_CONFIG == '^hdf5-debug$' ]]; then + ./check_source.py fi +./run_tests.py -C $OPENMC_CONFIG -j 2 +pytest --cov=../openmc -v unit_tests/