.gitlab-ci.yml 1.99 KB
Newer Older
Daniel Scheffler's avatar
Daniel Scheffler committed
1
2
3
before_script:
  - git lfs pull

4
5
6
7
8
9

stages:
    - test
    - deploy


10
test_gms_preprocessing:
11
  stage: test
Daniel Scheffler's avatar
Daniel Scheffler committed
12
  script:
13
14
    - source /root/miniconda3/bin/activate
    - export GDAL_DATA=/root/miniconda3/share/gdal
Daniel Scheffler's avatar
Daniel Scheffler committed
15
    - export PYTHONPATH=$PYTHONPATH:/root  # /root <- directory needed later
16
    - export GMS_db_host=geoms
17
18
19
20
21
22
23
24
    # update sicor
    # - conda install -y -q -c conda-forge basemap
    # - rm -rf context/sicor
    # - git clone https://gitext.gfz-potsdam.de/EnMAP/sicor.git ./context/sicor
    # - cd ./context/sicor
    # - make download-tables
    # - python setup.py install
    # - cd ../../
Daniel Scheffler's avatar
Daniel Scheffler committed
25
    # make tests
26
    - pip install nested_dict openpyxl  # FIXME: remove as soon as runner is rebuilt
27
    - make nosetests
Daniel Scheffler's avatar
Daniel Scheffler committed
28
29
30
31
32
    - make docs
  artifacts:
    paths:
    - htmlcov/
    - docs/_build/html/
33
34
    - nosetests.html
    - nosetests.xml
35
    when: always
Daniel Scheffler's avatar
Daniel Scheffler committed
36

37
38
39
40

test_styles:
  stage: test
  script:
41
42
    - source /root/miniconda3/bin/activate
    - export GDAL_DATA=/root/miniconda3/share/gdal
43
44
45
46
47
48
49
50
51
52
    - export PYTHONPATH=$PYTHONPATH:/root  # /root <- directory needed later
    - make lint
  artifacts:
    paths:
    - tests/linting/flake8.log
    - tests/linting/pycodestyle.log
    - tests/linting/pydocstyle.log
    when: always


53
pages:  # this job must be called 'pages' to advise GitLab to upload content to GitLab Pages
Daniel Scheffler's avatar
Daniel Scheffler committed
54
55
  stage: deploy
  dependencies:
56
    - test_gms_preprocessing
Daniel Scheffler's avatar
Daniel Scheffler committed
57
  script:
58
59
60
61
    # Create the public directory
    - rm -rf public
    - mkdir public
    - mkdir -p public/doc
Daniel Scheffler's avatar
Daniel Scheffler committed
62
    - mkdir -p public/coverage
Daniel Scheffler's avatar
Daniel Scheffler committed
63
    - mkdir -p public/nosetests_reports
64
    # Copy over the docs
Daniel Scheffler's avatar
Daniel Scheffler committed
65
    - cp -r docs/_build/html/* public/doc/
66
67
68
69
70
71
72
73
74
    # Copy over the coverage reports
    - cp -r htmlcov/* public/coverage/
    # Copy over the nosetests reports
    - cp nosetests.* public/nosetests_reports/
    # Check if everything is working great
    - ls -al public
    - ls -al public/doc
    - ls -al public/coverage
    - ls -al public/nosetests_reports
Daniel Scheffler's avatar
Daniel Scheffler committed
75
76
77
78
79
80
  artifacts:
    paths:
      - public
    expire_in: 30 days
  only:
    - master