Skip to content

Commit

Permalink
Merge pull request #21 from CDAT/migrateToCircleCI
Browse files Browse the repository at this point in the history
Migrate to circle ci
  • Loading branch information
doutriaux1 committed May 7, 2018
2 parents 4e836c4 + ef385e0 commit c0429f3
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 36 deletions.
81 changes: 81 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -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



6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ 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
- conda config --set always_yes yes --set changeps1 no
- 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
Expand All @@ -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
Expand Down
11 changes: 0 additions & 11 deletions ci-support/circleci_mac.sh

This file was deleted.

12 changes: 0 additions & 12 deletions ci-support/circleci_mac_dep.sh

This file was deleted.

7 changes: 0 additions & 7 deletions ci-support/circleci_mac_machine_pre.sh

This file was deleted.

6 changes: 3 additions & 3 deletions ci-support/conda_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit c0429f3

Please sign in to comment.