forked from Acellera/htmd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
executable file
·93 lines (77 loc) · 4.09 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
# Note on releases -- HTMD releases are now only made when a tag is pushed
sudo: required
dist: trusty
group: deprecated-2017Q4
matrix:
include:
- os: linux
language: python
python:
- "3.6"
env: MAKE_NOARCH=1 OSNAME=Linux # Only one build needs MAKE_NOARCH=1 to upload the noarch packages to conda
- os: linux
language: python
python:
- "3.5"
env: OSNAME=Linux
# TODO: Uncomment when MacOS comes back (travis-ci/travis-ci#9075)
# - os: osx
# language: generic
# env: TRAVIS_PYTHON_VERSION=3.6 OSNAME=Darwin
# before_install:
# - brew update
# - brew cask uninstall oclint
# - brew install gcc
install:
# Make sure stdout is in blocking mode. Otherwise builds will fail due to large writes to stdout
# See https://github.com/travis-ci/travis-ci/issues/4704. If this gets fixed, this line can also be removed.
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then python3 -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh; fi
- echo $PACKAGE_NAME
# Set up the Conda environment
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes
- conda install conda conda-build anaconda anaconda-client requests pytest -y -q # this has to go into the root environment
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then conda install gcc_linux-64 gxx_linux-64 -y -q; fi
- conda create -q -n travis-env python=$TRAVIS_PYTHON_VERSION
- echo "python $TRAVIS_PYTHON_VERSION*" > $HOME/miniconda/envs/travis-env/conda-meta/pinned
- source activate travis-env
- conda config --add channels acellera
- conda config --add channels psi4
- conda install anaconda-client -y -q
- conda update --all -y -q
- if [ "$TRAVIS_BRANCH" == "$TRAVIS_TAG" ]; then export BUILD_VERSION=$TRAVIS_TAG; else export BUILD_VERSION=0.0.0; fi
- echo "TRAVIS_BRANCH = $TRAVIS_BRANCH"
- echo "TRAVIS_TAG = $TRAVIS_TAG"
- echo "TRAVIS_PULL_REQUEST = $TRAVIS_PULL_REQUEST"
- echo "TRAVIS_REPO_SLUG = $TRAVIS_REPO_SLUG"
- echo "BUILD_VERSION = $BUILD_VERSION"
# Always set it to 0 so we don't get a new release at every successful commit
- export BUILD_NUMBER=0
# Install the Conda dependencies HTMD needs
- df -h
- conda install --file package/htmd-deps/DEPENDENCIES -y
- bash -x continuous-integration/travis/conda_build_htmd-data.sh
- conda install $HOME/miniconda/conda-bld/*/htmd-data-[0-9]*.tar.bz2 -y -q
# Cleaning to reduce amount of space used on disk
- conda clean --all -y
# Build and install the HTMD dependencies package
- python package/htmd-deps/write_meta_yaml.py package/htmd-deps
- conda build --python $TRAVIS_PYTHON_VERSION package/htmd-deps --no-include-recipe
- conda install $HOME/miniconda/conda-bld/*-64/htmd-deps-[0-9]*.tar.bz2 -y -q
# If not PR, clone the private htmdlib repo,
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then bash -x ./continuous-integration/travis/compile_htmdlib.sh ; fi
# Build and install HTMD
- conda build --python $TRAVIS_PYTHON_VERSION package/htmd --no-include-recipe
- conda install $HOME/miniconda/conda-bld/*-64/htmd-[0-9]*.tar.bz2 -y -q
# Cleaning to reduce amount of space used on disk
- conda clean --all -y
script:
- export HTMD_NONINTERACTIVE=1
- python htmd/tests/run_inline_file_tests.py
- htmd/tests/run_other_tests.sh
# If build did not fail, if it is not PR, it's on Acellera/htmd and a tagged build, do anaconda upload tasks
- if [ "$TRAVIS_TEST_RESULT" == "0" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_REPO_SLUG" == "Acellera/htmd" ] && [ "$TRAVIS_BRANCH" == "$TRAVIS_TAG" ]; then bash -x ./continuous-integration/travis/conda_upload.sh; bash -x ./continuous-integration/travis/conda_build_upload_meta.sh ; fi