|
1 | 1 | language: generic |
| 2 | +sudo: false # use container based build |
| 3 | + |
| 4 | +# set clone depth to false to make sure that conda build can write the |
| 5 | +# correct GIT_BUILD_STR |
| 6 | +git: |
| 7 | + depth: false |
| 8 | + |
2 | 9 | env: |
3 | | - global: |
4 | | - - secure: "FnfYmn2KQLCmLVPDQ5rRSyunT8rEh/HsBejTCEX34oWnYMp3FGPWJC2je/KvTV18EORZ5KhiHBvkqMnmm6WvEbCJhX/snBTufco74famK44hriEzZ0z+u5hDt8tifjhIEtI+zJXrSDvgcoa2piOlRb9SAnWBGhtGMVYX5oFgyH0zya9OFdw+tC7oUddi+2XkInZt8GfnBya83jE4sfxGj0F9dQYAoVGV0RPE1bHnk+vXpCpPuJgwFRolou5z7yr+MWDMZQ6dm3ocCHJ977w/x0fHyRSLXti2ZsGNKKU4p109y/4E1s9p9lYIRg61LsS5XUrQBcwTJ+x6avmFFnNNlPYKFg0H/cshXS1BiCrM+CNHW5gU0o+qKfdnjc4JJ4SZ3f+4viP1rv0EpLjHdDyrvB0Dk0WpS+eVIloa0S1IVhQenDbiM2ehBvyYNdSiczj6cXple0DSF8o87r2cRYfOyQuEOTJvmJs117PVeMCGy86jrI6kKfs7v4L3KJqxY8DcNFUnCHGio+e4KE5HIuYgXqNvJAbGHzs8SRPROhaRWM7OlCMKsdrGZLtPKTl7lI7j/rco0hg/53S/36uR74DmwAu0LS+I5/WyXgNYjvbys/xKeyfChRVWkfN7z8zI70dx/E74WRHBchtnZIvxO432+cyK61fwC9nX6s+X0swY4MY=" |
| 10 | + matrix: |
| 11 | + # python 3.8 |
| 12 | + - PYTHON_VERSION=3.8 USE_PIP=false DEPLOY_CONDA=true |
| 13 | + - PYTHON_VERSION=3.8 USE_PIP=false DEPLOY_CONDA=false XARRAY_VERSION=0.14 |
| 14 | + - PYTHON_VERSION=3.8 USE_PIP=true DEPLOY_CONDA=false |
| 15 | + # python 3.7 |
| 16 | + - PYTHON_VERSION=3.7 USE_PIP=false DEPLOY_CONDA=true |
| 17 | + - PYTHON_VERSION=3.7 USE_PIP=false DEPLOY_CONDA=false XARRAY_VERSION=0.14 |
| 18 | + - PYTHON_VERSION=3.7 USE_PIP=false DEPLOY_CONDA=false XARRAY_VERSION=0.13 |
| 19 | + - PYTHON_VERSION=3.7 USE_PIP=false DEPLOY_CONDA=false XARRAY_VERSION=0.12 |
| 20 | + global: |
| 21 | + - secure: "FnfYmn2KQLCmLVPDQ5rRSyunT8rEh/HsBejTCEX34oWnYMp3FGPWJC2je/KvTV18EORZ5KhiHBvkqMnmm6WvEbCJhX/snBTufco74famK44hriEzZ0z+u5hDt8tifjhIEtI+zJXrSDvgcoa2piOlRb9SAnWBGhtGMVYX5oFgyH0zya9OFdw+tC7oUddi+2XkInZt8GfnBya83jE4sfxGj0F9dQYAoVGV0RPE1bHnk+vXpCpPuJgwFRolou5z7yr+MWDMZQ6dm3ocCHJ977w/x0fHyRSLXti2ZsGNKKU4p109y/4E1s9p9lYIRg61LsS5XUrQBcwTJ+x6avmFFnNNlPYKFg0H/cshXS1BiCrM+CNHW5gU0o+qKfdnjc4JJ4SZ3f+4viP1rv0EpLjHdDyrvB0Dk0WpS+eVIloa0S1IVhQenDbiM2ehBvyYNdSiczj6cXple0DSF8o87r2cRYfOyQuEOTJvmJs117PVeMCGy86jrI6kKfs7v4L3KJqxY8DcNFUnCHGio+e4KE5HIuYgXqNvJAbGHzs8SRPROhaRWM7OlCMKsdrGZLtPKTl7lI7j/rco0hg/53S/36uR74DmwAu0LS+I5/WyXgNYjvbys/xKeyfChRVWkfN7z8zI70dx/E74WRHBchtnZIvxO432+cyK61fwC9nX6s+X0swY4MY=" |
| 22 | + |
| 23 | +os: |
| 24 | + - linux |
| 25 | + - osx |
| 26 | + |
| 27 | +services: |
| 28 | + - xvfb |
| 29 | + |
5 | 30 | matrix: |
6 | | - include: |
7 | | - # linux environments |
8 | | - - env: |
9 | | - - PYTHON_VERSION=3.7 |
10 | | - XARRAY_VERSION=0.12 |
11 | | - DEPLOY_CONDA=true |
12 | | - os: linux |
13 | | - - env: |
14 | | - - PYTHON_VERSION=3.7 |
15 | | - XARRAY_VERSION=0.11 |
16 | | - os: linux |
17 | | - - env: |
18 | | - - PYTHON_VERSION=3.7 |
19 | | - XARRAY_VERSION=0.10 |
20 | | - os: linux |
21 | | - - env: |
22 | | - - PYTHON_VERSION=3.6 |
23 | | - XARRAY_VERSION=0.9 |
24 | | - DEPLOY_CONDA=true |
25 | | - os: linux |
26 | | - - env: |
27 | | - - PYTHON_VERSION=3.6 |
28 | | - XARRAY_VERSION=0.8 |
29 | | - os: linux |
30 | | - # osx environments |
31 | | - - env: |
32 | | - - PYTHON_VERSION=3.7 |
33 | | - XARRAY_VERSION=0.12 |
34 | | - DEPLOY_CONDA=true |
35 | | - os: osx |
36 | | - - env: |
37 | | - - PYTHON_VERSION=3.7 |
38 | | - XARRAY_VERSION=0.11 |
39 | | - os: osx |
40 | | - - env: |
41 | | - - PYTHON_VERSION=3.7 |
42 | | - XARRAY_VERSION=0.10 |
43 | | - os: osx |
| 31 | + allow_failures: |
| 32 | + - env: PYTHON_VERSION=3.8 USE_PIP=true DEPLOY_CONDA=false |
| 33 | + |
| 34 | +before_install: |
| 35 | + - if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then export DEPLOY_CONDA=false; fi |
| 36 | + # Remove homebrew. |
| 37 | + - | |
| 38 | + if [[ $TRAVIS_OS_NAME == "osx" ]]; then |
| 39 | + echo "" |
| 40 | + echo "Removing homebrew from Travis CI to avoid conflicts." |
| 41 | + curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall > ~/uninstall_homebrew |
| 42 | + chmod +x ~/uninstall_homebrew |
| 43 | + ~/uninstall_homebrew -fq |
| 44 | + rm ~/uninstall_homebrew |
| 45 | + fi |
| 46 | + # define functions to unset and reset encrypted variables |
| 47 | + - function unset_secure { |
| 48 | + CONDA_TOKEN_SAVE=$CONDA_REPO_TOKEN; |
| 49 | + unset CONDA_REPO_TOKEN; |
| 50 | + } |
| 51 | + - function reset_secure { |
| 52 | + export CONDA_REPO_TOKEN=$CONDA_TOKEN_SAVE; |
| 53 | + } |
| 54 | + - unset_secure |
| 55 | + # increase open files limit |
| 56 | + - ulimit -a |
| 57 | + - ulimit -Sn 10000 |
| 58 | + - ulimit -a |
| 59 | + # select the os name for the conda installer |
| 60 | + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then |
| 61 | + OS_NAME=MacOSX; |
| 62 | + else |
| 63 | + OS_NAME=Linux; |
| 64 | + fi |
| 65 | + # Install Miniconda. |
| 66 | + - | |
| 67 | + echo "" |
| 68 | + echo "Installing a fresh version of Miniconda." |
| 69 | + MINICONDA_URL="https://repo.continuum.io/miniconda" |
| 70 | + MINICONDA_FILE="Miniconda3-latest-${OS_NAME}-x86_64.sh" |
| 71 | + curl -L -O "${MINICONDA_URL}/${MINICONDA_FILE}" |
| 72 | + bash $MINICONDA_FILE -bp $HOME/miniconda3 |
| 73 | + - source $HOME/miniconda3/bin/activate root |
| 74 | + - hash -r |
| 75 | + - reset_secure |
| 76 | + |
| 77 | +before_script: |
| 78 | + - if [[ $TRAVIS_OS_NAME == "linux" ]]; then |
| 79 | + export "DISPLAY=:99.0"; |
| 80 | + sh -e /etc/init.d/xvfb start; |
| 81 | + sleep 3; |
| 82 | + fi |
44 | 83 |
|
45 | 84 | install: |
46 | | - # select the os name for the conda installer |
47 | | - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then |
48 | | - OS_NAME=MacOSX; |
49 | | - else |
50 | | - OS_NAME=Linux; |
51 | | - fi |
52 | | - # We do this conditionally because it saves us some downloading if the |
53 | | - # version is the same. |
54 | | - - wget https://repo.continuum.io/miniconda/Miniconda3-latest-"${OS_NAME}"-x86_64.sh -O miniconda.sh |
55 | | - # make sure we use an 'innocent' default matplotlib environment |
56 | | - - touch matplotlibrc |
57 | | - - bash miniconda.sh -b -p $HOME/miniconda |
58 | | - - . $HOME/miniconda/etc/profile.d/conda.sh && conda activate base |
59 | | - - pip install pyyaml # is somehow not included in the current conda installation |
60 | | - - hash -r |
61 | | - - conda config --set always_yes yes --set changeps1 no |
62 | | - - conda update -q conda |
63 | | - # install conda build and anaconda-client for deploy |
64 | | - - conda install conda-build anaconda-client |
65 | | - # Useful for debugging any issues with conda |
66 | | - - conda info -a |
67 | | - - 'ENVKEY=py"${PYTHON_VERSION}"_xr"${XARRAY_VERSION}"' |
68 | | - - conda env create -f tests/envs/environment_$ENVKEY.yml |
69 | | - - conda activate psyplot_$ENVKEY |
70 | | - # install python cdo bindings |
71 | | - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then |
72 | | - conda install -c conda-forge cdo python-cdo; |
73 | | - export CDO="$HOME/miniconda/envs/psyplot_$ENVKEY/bin/cdo"; |
74 | | - fi |
75 | | - - if [[ $TRAVIS_TAG == "" ]]; then export GIT_BRANCH=$TRAVIS_BRANCH; fi |
76 | | - # install coveralls |
77 | | - - pip install coveralls |
78 | | - # install the test plugin |
79 | | - - cd tests/test_plugin && python setup.py install && cd ../../ |
80 | | - # install psyplot |
81 | | - - python setup.py install |
82 | | - # export the environment for debugging |
83 | | - - conda env export -n psyplot_$ENVKEY |
84 | | - # print versions of all the important requirements |
85 | | - - psyplot -aV |
86 | | - # add conda-forge channel for build |
87 | | - - conda config --add channels conda-forge |
| 85 | + # unset the global CONDA_REPO_TOKEN variable because it is not needed |
| 86 | + # during the tests. This decreases the vulnerability |
| 87 | + - unset_secure |
| 88 | + - | |
| 89 | + echo "" |
| 90 | + echo "Configuring conda." |
| 91 | + conda config --set always_yes yes --set changeps1 no |
| 92 | + conda config --add channels conda-forge |
| 93 | + conda config --add channels chilipp |
| 94 | + conda update -q conda |
| 95 | + conda install conda-build anaconda-client conda-verify |
| 96 | + - if [[ $TRAVIS_TAG == "" ]]; then |
| 97 | + export GIT_BRANCH=$TRAVIS_BRANCH; |
| 98 | + conda config --add channels chilipp/label/${TRAVIS_BRANCH} |
| 99 | + fi |
| 100 | + - python ci/setup_append.py ci/conda-recipe xarray=${XARRAY_VERSION} |
| 101 | + - if [[ $USE_PIP == true ]]; then pip install .; fi |
| 102 | + - conda info -a |
| 103 | + - conda list |
| 104 | + - reset_secure |
88 | 105 | script: |
89 | | - - coverage run --source=psyplot setup.py test -a "-v" |
90 | | - - conda build ci/conda-recipe --python $PYTHON_VERSION |
91 | | - # deploy here (don't use travis deploy because it requires homebrew) |
92 | | - - if [[ $TRAVIS_PULL_REQUEST == "false" && $TRAVIS_REPO_SLUG == "Chilipp/psyplot" && $DEPLOY_CONDA == "true" ]]; then |
93 | | - conda activate base; |
94 | | - ci/deploy_anaconda.py; |
95 | | - fi |
96 | | - |
97 | | -after_success: |
98 | | - - coveralls |
| 106 | + - unset_secure |
| 107 | + # install conda |
| 108 | + - if [[ $USE_PIP == true ]]; then |
| 109 | + coverage run --source=psyplot setup.py test -a "-v" && codecov |
| 110 | + else |
| 111 | + conda build conda-recipe --python $PYTHON_VERSION; |
| 112 | + fi |
| 113 | + # export the pw to make it available for the deploy |
| 114 | + - reset_secure |
| 115 | + # deploy here (don't use travis deploy because it requires homebrew) |
| 116 | + - if [[ $DEPLOY_CONDA == "true" && $USE_PIP == "false" && $TRAVIS_PULL_REQUEST == "false" && $TRAVIS_REPO_SLUG == "Chilipp/straditize" ]]; then |
| 117 | + ci/deploy_anaconda.py; |
| 118 | + fi |
0 commit comments