Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to circle ci2 #2

Merged
merged 21 commits into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 132 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
version: 2

checkout:
post:
- ./scripts/checkout_merge_commit.sh

aliases:

- &setup_miniconda
name: setup_miniconda
command: |
mkdir -p workspace
git clone -b validateNightly [email protected]:CDAT/cdat workspace/cdat
ls workspace/cdat
python workspace/cdat/scripts/install_miniconda.py -w $WORKDIR -p 'py3'

- &create_conda_env
name: create_conda_env
command: |
export PATH=$HOME/project/$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 -q -n py2 -c conda-forge hdf5 libnetcdf lapack clapack curl ossuuid gcc "python<3" "numpy>1.14"
conda create -q -n py3 -c conda-forge hdf5 libnetcdf lapack clapack curl ossuuid gcc "python>3" "numpy>1.14"
if [ $(uname) == "Linux" ]; then
conda install -n py3 -c cdat/label/unstable -c cdat/label/nightly -c conda-forge gcc_linux-64
conda install -n py2 -c cdat/label/unstable -c cdat/label/nightly -c conda-forge gcc_linux-64
else
conda install -n py3 -c cdat/label/unstable -c cdat/label/nightly -c conda-forge gcc
conda install -n py2 -c cdat/label/unstable -c cdat/label/nightly -c conda-forge gcc
fi

source activate py2
conda list

- &run_libcf_tests
name: run_libcf_tests
command: |
export PATH=$WORKDIR/miniconda/bin:$PATH
echo "CIRCLE CI BRANCH: "$CIRCLE_BRANCH
echo "CI_PULL_REQUESTS: "$CI_PULL_REQUESTS
echo "CI_PULL_REQUEST: "$CI_PULL_REQUEST
export CFLAGS="-Wall -m64 -pipe -O2 -fPIC ${CFLAGS}"
export CXXFLAGS="${CFLAGS} ${CXXFLAGS}"
export LFLAGS="-fPIC ${LFLAGS}"
# somehow looks for fortran but doesn't seem to need it it's pure C
# looking for fortran makes mac fail
source activate base
export FC=""
pwd
ls
echo "xxx running configure py2"
source activate py2
export PREFIX=$CONDA_PREFIX
export CPPFLAGS="-I${PREFIX}/include ${CPPFLAGS}"
export LDFLAGS="-L${PREFIX}/lib ${LDFLAGS}"
./configure --prefix=${PREFIX}
echo "xxx running python install"
if [ $(uname) == "Linux" ]; then
LDSHARED="$CC -shared -pthread" python setup.py install
else
python setup.py install
fi
echo "xxx running configure py3"
source activate py3
export PREFIX=$CONDA_PREFIX
export CPPFLAGS="-I${PREFIX}/include ${CPPFLAGS}"
export LDFLAGS="-L${PREFIX}/lib ${LDFLAGS}"
./configure --prefix=${PREFIX}
echo "xxx running python install"
if [ $(uname) == "Linux" ]; then
LDSHARED="$CC -shared -pthread" python setup.py install
else
python setup.py install
fi
echo "py3 test command exit result:",$RESULT

- &upload_libcf
name: upload_libcf
command: |
export PATH=$HOME/project/$WORKDIR/miniconda/bin:$PATH
if [ $CIRCLE_BRANCH == "master" ]; then conda install -n root conda-build anaconda-client ; fi
if [ $CIRCLE_BRANCH == "master" ]; then bash ./ci-support/conda_upload.sh ; fi
if [ $CIRCLE_BRANCH != "master" ]; then
export LABEL="unstable";
conda install -n root conda-build anaconda-client;
bash ./ci-support/conda_upload.sh;
fi



jobs:
macos_libcf:
macos:
xcode: "9.2.0"
environment:
WORKDIR: "workspace/test_macos_libcf"
steps:
- checkout
- run: *setup_miniconda
- run: *create_conda_env
- run: *run_libcf_tests
- run: *upload_libcf

linux_libcf:
machine:
image: circleci/classic:latest
environment:
WORKDIR: "workspace/test_linux_libcf"
steps:
- checkout
- run: *setup_miniconda
- run: *create_conda_env
- run: *run_libcf_tests
- run: *upload_libcf
- store_artifacts:
path: tests_html
destination: tests_html
- store_artifacts:
path: tests_png
destination: tests_png

workflows:
version: 2
libcf:
jobs:
- macos_libcf
- linux_libcf



4 changes: 2 additions & 2 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
[m4_warning([this file was generated for autoconf 2.68.
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
[m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
Expand Down
10 changes: 5 additions & 5 deletions cf_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

/* Define to a macro mangling the given C identifier (in lower and upper
case), which must not contain underscores, for linking with Fortran. */
#define FC_FUNC(name,NAME) name ## _
/* #undef FC_FUNC */

/* As FC_FUNC, but for C identifiers containing underscores. */
#define FC_FUNC_(name,NAME) name ## _
/* #undef FC_FUNC_ */

/* Define to 1 if you have `alloca', as a function or macro. */
#define HAVE_ALLOCA 1
Expand Down Expand Up @@ -120,7 +120,7 @@
#define PACKAGE_NAME "libcf"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libcf 1.0-beta11"
#define PACKAGE_STRING "libcf 1.0-beta12"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libcf"
Expand All @@ -129,7 +129,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "1.0-beta11"
#define PACKAGE_VERSION "1.0-beta12"

/* The size of `double', as computed by sizeof. */
#define SIZEOF_DOUBLE 8
Expand Down Expand Up @@ -164,7 +164,7 @@
/* #undef USE_PARALLEL */

/* Version number of package */
#define VERSION "1.0-beta11"
#define VERSION "1.0-beta12"

/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
Expand Down
34 changes: 34 additions & 0 deletions ci-support/conda_upload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
PKG_NAME=libcf
USER=cdat
export VERSION="3.0"
echo "Trying to upload to conda"
echo ""
echo "Activating base env"
source activate base
echo "Making sure conda-build is installed"
conda install "conda-build<3.10"
echo "Updating conda"
conda update -y -q conda
if [ `uname` == "Linux" ]; then
OS=linux-64
echo "Linux OS"
else
echo "Mac OS"
OS=osx-64
fi

mkdir ~/conda-bld
conda config --set anaconda_upload no
export CONDA_BLD_PATH=${HOME}/conda-bld
echo "Cloning recipes"
git clone git://github.com/CDAT/conda-recipes
cd conda-recipes
# uvcdat creates issues for build -c uvcdat confises package and channel
rm -rf uvcdat
export BRANCH=${CIRCLE_BRANCH}
python ./prep_for_build.py -b ${BRANCH}

conda build $PKG_NAME -c conda-forge -c cdat -c uvcdat --python=27
conda build $PKG_NAME -c cdat/label/nightly -c conda-forge -c cdat -c uvcdat --python=3.6
anaconda -t $CONDA_UPLOAD_TOKEN upload -u $USER -l $LABEL $CONDA_BLD_PATH/$OS/$PKG_NAME-$VERSION.`date +%Y*`0.tar.bz2 --force
Loading