diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..4ccc92c --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,81 @@ +version: 2 + +checkout: + post: + - ./ci-support/checkout_merge_commit.sh + +aliases: + + - &setup_miniconda + name: setup_miniconda + command: | + mkdir -p workspace + git clone -b validateNightly git@github.com:CDAT/cdat workspace/cdat + ls workspace/cdat + # following will install miniconda3 under $WORKDIR/miniconda/bin + python workspace/cdat/scripts/install_miniconda.py -w $WORKDIR -p 'py3' + + - &create_conda_env + name: create_conda_env + command: | + export PATH=$WORKDIR/miniconda/bin:$PATH + conda config --set always_yes yes --set changeps1 no + conda update -y -q conda + conda config --set anaconda_upload no + conda create -n py2 -c cdat/label/nightly -c conda-forge -c cdat cdms2 cdat_info udunits2 nose flake8 "python<3" numpy + conda create -n py3 -c cdat/label/nightly -c conda-forge -c cdat cdms2 nose flake8 "python>3" cdat_info udunits2 numpy + + + - &setup_genutil + name: setup_genutil + command: | + export PATH=$WORKDIR/miniconda/bin:$PATH + export UVCDAT_ANONYMOUS_LOG=False + source activate py3 + python setup.py install + source activate py2 + rm -rf build + python setup.py install + + - &run_genutil_tests + name: run_genutil_tests + command: | + export PATH=$WORKDIR/miniconda/bin:$PATH + export UVCDAT_ANONYMOUS_LOG=False + set -e + source activate py2 + python run_tests.py -H -v2 + PY2_RESULT=$? + echo "*** py2 test result: "${PY2_RESULT} + source activate py3 + python run_tests.py -H -v2 + PY3_RESULT=$? + echo "*** py3 test result: "${PY3_RESULT} + if [ $PY2_RESULT -eq 0 -a $PY3_RESULT -eq 0 -a $CIRCLE_BRANCH == "master" ]; then bash ./ci-support/conda_upload.sh ; fi + if [ $PY2_RESULT -ne 0 -o $PY3_RESULT -ne 0]; then + exit 1 + fi +jobs: + macos_genutil: + macos: + xcode: "9.2.0" + environment: + WORKDIR: "workspace/test_macos_genutil" + steps: + - checkout + - run: *setup_miniconda + - run: *create_conda_env + - run: *setup_genutil + - run: *run_genutil_tests + - store_artifacts: + path: tests_html + destination: tests_html + +workflows: + version: 2 + nightly: + jobs: + - macos_genutil + + + diff --git a/.travis.yml b/.travis.yml index 564f537..28a9fa2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ os: - linux sudo: false before_install: -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then wget https://repo.continuum.io/miniconda/Miniconda2-4.3.21-Linux-x86_64.sh -O miniconda.sh; fi +- if [ "$TRAVIS_OS_NAME" = "linux" ]; then wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O miniconda.sh; fi - export PATH="$HOME/miniconda/bin:$PATH" - bash miniconda.sh -b -p $HOME/miniconda @@ -10,7 +10,7 @@ before_install: - conda update -y -q conda #- conda install gcc script: -- conda create -n py2 -c cdat/label/nightly -c uvcdat/label/nightly -c conda-forge -c uvcdat cdms2 cdat_info udunits2 nose flake8 "python<3" "numpy>1.14" +- conda create -n py2 -c cdat/label/nightly -c conda-forge -c cdat cdms2 cdat_info udunits2 nose flake8 "python<3" numpy - export UVCDAT_ANONYMOUS_LOG=False - echo $TRAVIS_BRANCH - export TRAVIS_PR_BRANCH=$TRAVIS_BRANCH @@ -20,7 +20,7 @@ script: - python setup.py install - python run_tests.py -v2 - rm -rf build -- conda create -n py3 -c nesii/channel/dev-esmf -c cdat/label/nightly -c uvcdat/label/nightly -c conda-forge -c uvcdat cdms2 nose flake8 "python>3" udunits2 cdat_info "numpy>1.14" +- conda create -n py3 -c cdat/label/nightly -c conda-forge -c cdat cdms2 nose flake8 "python>3" udunits2 cdat_info numpy - source activate py3 - python setup.py install - python run_tests.py -v2 diff --git a/ci-support/circleci_mac.sh b/ci-support/circleci_mac.sh deleted file mode 100644 index 2ee4019..0000000 --- a/ci-support/circleci_mac.sh +++ /dev/null @@ -1,11 +0,0 @@ -export UVCDAT_ANONYMOUS_LOG=False -export PATH=${HOME}/miniconda/bin:${PATH} -source activate py2 -python run_tests.py -v2 -RESULT=$? -source activate py3 -python run_tests.py -v2 -RESULT=$(( $RESULT + $? )) -echo "RESULT:"${RESULT} -if [ $RESULT -eq 0 -a $CIRCLE_BRANCH == "master" ]; then bash ./ci-support/conda_upload.sh ; fi -exit $RESULT diff --git a/ci-support/circleci_mac_dep.sh b/ci-support/circleci_mac_dep.sh deleted file mode 100644 index 74b4d38..0000000 --- a/ci-support/circleci_mac_dep.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -ls -pwd -export PATH=${HOME}/miniconda/bin:${PATH} -conda create -n py2 -c cdat/label/nightly -c uvcdat/label/nightly -c conda-forge -c uvcdat cdms2 cdat_info udunits2 nose flake8 "python<3" "numpy>1.14" -conda create -n py3 -c cdat/label/nightly -c uvcdat/label/nightly -c nesii/label/dev-esmf -c conda-forge -c uvcdat cdms2 nose flake8 "python>3" cdat_info udunits2 "numpy>1.14" -export UVCDAT_ANONYMOUS_LOG=False -source activate py3 -python setup.py install -source activate py2 -rm -rf build -python setup.py install diff --git a/ci-support/circleci_mac_machine_pre.sh b/ci-support/circleci_mac_machine_pre.sh deleted file mode 100644 index b46a4b3..0000000 --- a/ci-support/circleci_mac_machine_pre.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -curl https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -o miniconda.sh -bash miniconda.sh -b -p $HOME/miniconda -export PATH=${HOME}/miniconda/bin:${PATH} -conda config --set always_yes yes --set changeps1 no -conda update -y -q conda -conda config --set anaconda_upload no diff --git a/ci-support/conda_upload.sh b/ci-support/conda_upload.sh index 7c5c922..cfdeca7 100755 --- a/ci-support/conda_upload.sh +++ b/ci-support/conda_upload.sh @@ -3,16 +3,16 @@ PKG_NAME=genutil USER=cdat export PATH="$HOME/miniconda/bin:$PATH" echo "Trying to upload conda" -ESMF_CHANNEL="nesii/label/dev-esmf" if [ `uname` == "Linux" ]; then OS=linux-64 echo "Linux OS" - conda update -y -q conda else echo "Mac OS" OS=osx-64 fi +conda update -y -q conda + mkdir ~/conda-bld source activate root conda install -q anaconda-client conda-build @@ -26,5 +26,5 @@ cd conda-recipes rm -rf uvcdat python ./prep_for_build.py echo "Building and uploading now" -conda build -c ${ESMF_CHANNEL} -c conda-forge -c cdat/label/nightly -c uvcdat/label/nightly -c uvcdat ${PKG_NAME} +conda build -c cdat/label/nightly -c conda-forge -c cdat ${PKG_NAME} anaconda -t $CONDA_UPLOAD_TOKEN upload -u $USER -l nightly $CONDA_BLD_PATH/$OS/$PKG_NAME*.tar.bz2 --force