.gitlab-ci.yml 1.39 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

Martin Reinecke's avatar
Martin Reinecke committed
19
test_all:
Jait Dixit's avatar
Jait Dixit committed
20 21 22
  stage: test
  script:
    - python setup.py build_ext --inplace
Martin Reinecke's avatar
Martin Reinecke committed
23
    - nosetests
24
    - ci/install_pyHealpix.sh
25
    - ci/install_mpi4py.sh
Jait Dixit's avatar
Jait Dixit committed
26
    - python setup.py build_ext --inplace
Martin Reinecke's avatar
Martin Reinecke committed
27
    - nosetests
28
    - ci/install_pyfftw.sh
Jait Dixit's avatar
Jait Dixit committed
29
    - python setup.py build_ext --inplace
Martin Reinecke's avatar
Martin Reinecke committed
30
    - nosetests
31
    - ci/install_h5py.sh
Jait Dixit's avatar
Jait Dixit committed
32
    - python setup.py build_ext --inplace
Martin Reinecke's avatar
Martin Reinecke committed
33
    - nosetests --with-coverage --cover-package=nifty --cover-branches
Jait Dixit's avatar
Jait Dixit committed
34 35
    - >
      coverage report | grep TOTAL | awk '{ print "TOTAL: "$6; }'
Jait Dixit's avatar
Jait Dixit committed
36

37
release_image_master:
Jait Dixit's avatar
Jait Dixit committed
38 39 40 41
  image: docker:latest
  stage: release
  before_script:
    - pwd
Theo Steininger's avatar
Theo Steininger committed
42 43
  services:
    - docker:dind
Jait Dixit's avatar
Jait Dixit committed
44
  script:
45
    - docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD
46 47 48 49 50 51 52 53 54 55
    - 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
56 57
  services:
    - docker:dind
58 59 60 61 62 63
  script:
    - docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD
    - docker build -t $RELEASE_IMAGE_TAGGED .
    - docker push $RELEASE_IMAGE_TAGGED
  only:
    - tags