Skip to content

Commit

Permalink
Bitbucket: Setup Pipelines service
Browse files Browse the repository at this point in the history
  • Loading branch information
dalcinl committed Jun 10, 2016
1 parent 7fe74e5 commit 95949de
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ recursive-include docs/apiref *
recursive-include docs/source *

prune misc
prune conf/ci
prune conf/conda-recipes
prune conf/anaconda
prune conf/appveyor
Expand Down
12 changes: 12 additions & 0 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pipelines:
default:
- step:
script:
- source conf/ci/bitbucket.sh
- install-anaconda
- test-package python=2.7 MPI=mpich
- test-package python=3.4 MPI=mpich
- test-package python=3.5 MPI=mpich
- test-package python=2.7 MPI=openmpi
- test-package python=3.4 MPI=openmpi
- test-package python=3.5 MPI=openmpi
41 changes: 41 additions & 0 deletions conf/ci/bitbucket.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
# Test script running on Bitbucket Pipelines
# https://bitbucket.org/mpi4py/mpi4py/addon/pipelines/home

RUN() { echo + $@; $@; }
RUN export ANACONDA=/opt/anaconda
RUN export CFLAGS=-O0

install-anaconda() {
MINICONDA=Miniconda2-latest-Linux-$(arch).sh
RUN wget --quiet -P ~ http://repo.continuum.io/miniconda/$MINICONDA
RUN bash ~/$MINICONDA -b -f -p $ANACONDA
RUN source $ANACONDA/bin/activate root
RUN conda config --set show_channel_urls yes
RUN conda install --quiet --yes -n root conda-build
}

test-package() {
for arg in $@; do
case $arg in
python=?*)
PY="${arg#*=}";;
MPI=?*)
MPI="${arg#*=}";;
*)
break
esac
done
PY=${PY-2.7} MPI=${MPI-mpich}
RUN source $ANACONDA/bin/activate root
RUN rm -rf $ANACONDA/envs/test
RUN conda create --quiet --yes -n test --channel mpi4py python=$PY $MPI numpy nomkl cython
RUN source activate test
RUN python setup.py build_src --force
RUN python setup.py install
RUN python setup.py --quiet clean --all
if [[ "$MPI" == "mpich" ]]; then P=2; else P=5; fi
if [[ "$MPI" == "openmpi" ]]; then ARGS=--allow-run-as-root; else ARGS=; fi
RUN mpiexec $ARGS -n 1 python $PWD/test/runtests.py -v -f --exclude=spawn
RUN mpiexec $ARGS -n $P python $PWD/test/runtests.py -v -f --exclude=spawn
}

0 comments on commit 95949de

Please sign in to comment.