.gitlab-ci.yml 2.34 KB
Newer Older
Gregory Ashton's avatar
Gregory Ashton committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# This script is an edited version of the example found at
# https://git.ligo.org/lscsoft/example-ci-project/blob/python/.gitlab-ci.yml
# Each 0th-indendation level is a job that will be run within GitLab CI
# The only exception are a short list of reserved keywords
#
# https://docs.gitlab.com/ee/ci/yaml/#gitlab-ci-yml

# stages is a reserved keyword that defines job dependencies and
# parallelization. each stage runs in parallel but must complete
# before the next stage begins

stages:
  - test
  - deploy

# test example on Debian 8 "jessie"
exitcode-jessie:
  stage: test
  image: ligo/software:jessie
Gregory Ashton's avatar
Gregory Ashton committed
20 21 22 23
  before_script:
    # Remove lalsuite from requirements for CI tests - the pip version in the
    # CI is too old and fails when trying to install lalsuite
    - sed -i '/lalsuite/d' requirements.txt
24
    - pip install -r requirements.txt
25
    - pip install 'coverage>=4.5'
Gregory Ashton's avatar
Gregory Ashton committed
26
    - pip install coverage-badge
Gregory Ashton's avatar
Gregory Ashton committed
27
  script:
28
    - python setup.py install
Gregory Ashton's avatar
Gregory Ashton committed
29
    # Run tests and collect coverage data
30
    - coverage --version
31
    - coverage erase
Gregory Ashton's avatar
Gregory Ashton committed
32 33
    - coverage run --source /usr/local/lib/python2.7/dist-packages/tupak/ -a test/conversion_tests.py
    - coverage run --source /usr/local/lib/python2.7/dist-packages/tupak/ -a test/detector_tests.py
34
    - coverage run --source /usr/local/lib/python2.7/dist-packages/tupak/ -a test/utils_tests.py
Gregory Ashton's avatar
Gregory Ashton committed
35 36 37
    - coverage run --source /usr/local/lib/python2.7/dist-packages/tupak/ -a test/prior_tests.py
    - coverage run --source /usr/local/lib/python2.7/dist-packages/tupak/ -a test/sampler_tests.py
    - coverage run --source /usr/local/lib/python2.7/dist-packages/tupak/ -a test/waveform_generator_tests.py
38 39
    - coverage html
    - coverage-badge -o coverage_badge.svg -f
Gregory Ashton's avatar
Gregory Ashton committed
40 41 42
    # Run all other tests (no coverage data collected)
    - python test/example_tests.py
    - python test/noise_realisation_tests.py
43
    - python test/other_tests.py
44 45 46 47

    # Make the documentation
    - pip install -r docs/requirements.txt
    - cd docs
Gregory Ashton's avatar
Gregory Ashton committed
48
    - make clean
49 50
    - make html

Gregory Ashton's avatar
Gregory Ashton committed
51 52 53
  artifacts:
    paths:
      - htmlcov/
54
      - coverage_badge.svg
55
      - docs/_build/html/
Gregory Ashton's avatar
Gregory Ashton committed
56 57 58 59 60 61

pages:
  stage: deploy
  dependencies:
    - exitcode-jessie
  script:
62
    - mkdir public/
Gregory Ashton's avatar
Gregory Ashton committed
63
    - mv htmlcov/ public/
64
    - mv /builds/Monash/tupak/coverage_badge.svg public/
65
    - mv docs/_build/html/* public/
Gregory Ashton's avatar
Gregory Ashton committed
66 67 68 69 70 71
  artifacts:
    paths:
      - public
    expire_in: 30 days
  #only:
    #- master