.gitlab-ci.yml 1.76 KB
Newer Older
Jait Dixit's avatar
Jait Dixit committed
1 2 3 4 5 6 7 8
image: ubuntu:latest

stages:
  - test
  - release

variables:
  DOCKER_DRIVER: overlay
9
  RELEASE_IMAGE_MASTER: iftmpa/nifty:dev
10
  RELEASE_IMAGE_TAGGED: iftmpa/nifty:$CI_BUILD_TAG
Jait Dixit's avatar
Jait Dixit committed
11 12 13

before_script:
  - apt-get update
Theo Steininger's avatar
Theo Steininger committed
14
  - chmod +x ci/*.sh
15 16
  - ci/install_basics.sh
  - pip install --upgrade -r ci/requirements.txt
Theo Steininger's avatar
Theo Steininger committed
17

Jait Dixit's avatar
Jait Dixit committed
18

19
test_min:
Jait Dixit's avatar
Jait Dixit committed
20 21 22
  stage: test
  script:
    - python setup.py build_ext --inplace
23 24 25 26 27
    - nosetests -vv

test_mpi:
  stage: test
  script:
28
    - ci/install_pyHealpix.sh
29
    - ci/install_mpi4py.sh
Jait Dixit's avatar
Jait Dixit committed
30
    - python setup.py build_ext --inplace
31 32 33 34 35 36 37
    - nosetests -vv

test_mpi_fftw:
  stage: test
  script:
    - ci/install_pyHealpix.sh
    - ci/install_mpi4py.sh
38
    - ci/install_pyfftw.sh
Jait Dixit's avatar
Jait Dixit committed
39
    - python setup.py build_ext --inplace
40
    - nosetests -vv
41 42 43 44 45 46 47

test_mpi_fftw_hdf5:
  stage: test
  script:
    - ci/install_pyHealpix.sh
    - ci/install_mpi4py.sh
    - ci/install_pyfftw.sh
48
    - ci/install_h5py.sh
Jait Dixit's avatar
Jait Dixit committed
49
    - python setup.py build_ext --inplace
50
    - mpiexec --allow-run-as-root -n 2 nosetests -vv
51
    - mpiexec --allow-run-as-root -n 4 nosetests
52
    - nosetests -vv --with-coverage --cover-package=nifty --cover-branches
Jait Dixit's avatar
Jait Dixit committed
53 54
    - >
      coverage report | grep TOTAL | awk '{ print "TOTAL: "$6; }'
Jait Dixit's avatar
Jait Dixit committed
55

56
release_image_master:
Jait Dixit's avatar
Jait Dixit committed
57 58 59 60
  image: docker:latest
  stage: release
  before_script:
    - pwd
Theo Steininger's avatar
Theo Steininger committed
61 62
  services:
    - docker:dind
Jait Dixit's avatar
Jait Dixit committed
63
  script:
64
    - docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD
65 66 67 68 69 70 71 72 73 74
    - docker build -t $RELEASE_IMAGE_MASTER .
    - docker push $RELEASE_IMAGE_MASTER
  only:
    - master

release_image_tagged:
  image: docker:latest
  stage: release
  before_script:
    - pwd
Theo Steininger's avatar
Theo Steininger committed
75 76
  services:
    - docker:dind
77 78 79 80 81 82
  script:
    - docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD
    - docker build -t $RELEASE_IMAGE_TAGGED .
    - docker push $RELEASE_IMAGE_TAGGED
  only:
    - tags