.gitlab-ci.yml 1.72 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 20
# 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
  script:
21
    - pip install -r requirements.txt
Gregory Ashton's avatar
Gregory Ashton committed
22 23
    - pip install coverage
    - pip install coverage-badge
24
    - python setup.py install
25
    - coverage erase
Moritz Huebner's avatar
Moritz Huebner committed
26
    - coverage run --include=tupak/* -a test/detector_tests.py
27
    - coverage run --include=tupak/* -a test/prior_tests.py
Moritz Huebner's avatar
Moritz Huebner committed
28
    - coverage run --include=tupak/* -a test/sampler_tests.py
29
    - coverage run --include=tupak/* -a test/waveform_generator_tests.py
Moritz Huebner's avatar
Moritz Huebner committed
30
    - coverage html
31
    - coverage-badge -o coverage_badge.svg -f
Moritz Huebner's avatar
Moritz Huebner committed
32 33 34
    - coverage run --omit=* -a test/example_tests.py
    - coverage run --omit=* -a test/noise_realisation_tests.py
    - coverage run --omit=* -a test/tests.py
35 36 37 38

    # Make the documentation
    - pip install -r docs/requirements.txt
    - cd docs
Gregory Ashton's avatar
Gregory Ashton committed
39
    - make clean
40 41
    - make html

Gregory Ashton's avatar
Gregory Ashton committed
42 43 44
  artifacts:
    paths:
      - htmlcov/
45
      - coverage_badge.svg
46
      - docs/_build/html/
Gregory Ashton's avatar
Gregory Ashton committed
47 48 49 50 51 52

pages:
  stage: deploy
  dependencies:
    - exitcode-jessie
  script:
53
    - mkdir public/
Gregory Ashton's avatar
Gregory Ashton committed
54
    - mv htmlcov/ public/
55
    - mv /builds/Monash/tupak/coverage_badge.svg public/
56
    - mv docs/_build/html/* public/
Gregory Ashton's avatar
Gregory Ashton committed
57 58 59 60 61 62
  artifacts:
    paths:
      - public
    expire_in: 30 days
  #only:
    #- master