.gitlab-ci.yml 2.25 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
# 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
19
  image: continuumio/anaconda3
Gregory Ashton's avatar
Gregory Ashton committed
20 21
  before_script:
    - sed -i '/lalsuite/d' requirements.txt
22
    - apt install -y libgl1-mesa-glx
23
    - pip install -r requirements.txt
24
    - pip install 'coverage>=4.5'
Gregory Ashton's avatar
Gregory Ashton committed
25
    - pip install coverage-badge
Gregory Ashton's avatar
Gregory Ashton committed
26
  script:
27
    - python setup.py install
Gregory Ashton's avatar
Gregory Ashton committed
28
    # Run tests and collect coverage data
29
    - coverage --version
30
    - coverage erase
31 32 33 34 35 36
    - coverage run --debug=trace --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/conversion_tests.py
    - coverage run --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/detector_tests.py
    - coverage run --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/utils_tests.py
    - coverage run --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/prior_tests.py
    - coverage run --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/sampler_tests.py
    - coverage run --include=/opt/conda/lib/python3.6/site-packages/tupak* -a test/waveform_generator_tests.py
37 38
    - coverage html
    - coverage-badge -o coverage_badge.svg -f
Gregory Ashton's avatar
Gregory Ashton committed
39 40 41
    # Run all other tests (no coverage data collected)
    - python test/example_tests.py
    - python test/noise_realisation_tests.py
42 43 44 45

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

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

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