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

4

5
6
7
8
9
10
11
# Advise GitLab that these environment vars should be loaded from the Variables config.
variables:
    GMS_DB_HOST: SECURE
    GMS_INDEX_HOST: SECURE
    GMS_INDEX_PORT: SECURE


12
13
14
15
16
stages:
    - test
    - deploy


17
test_gms_preprocessing:
18
  stage: test
Daniel Scheffler's avatar
Daniel Scheffler committed
19
  script:
20
    - source /root/miniconda3/bin/activate ci_env
21
22
23
    - export GMS_db_host=${GMS_DB_HOST}
    - export GMS_index_host=${GMS_INDEX_HOST}
    - export GMS_index_port=${GMS_INDEX_PORT}
24

25
26
27
28
29
30
31
32
    # 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
33
    # make tests
34
    - pip install -U sicor
35
36
37
38
39
40
41
    - python -c '\
        from sicor.tables import get_tables; \
        get_tables(sensor="s2"); \
        get_tables(sensor="l8"); \
        get_tables(sensor="enmap", \
        optional_downloads=("ch4",))\
        '
42

43
    - pip install 'scipy==1.1.0'  # TODO remove as soon as pinning is included in SICOR requirements or SICOR issue #63 is fixed
44

45
    # run tests
46
    - make nosetests
Daniel Scheffler's avatar
Daniel Scheffler committed
47
48
49
50
51
    - make docs
  artifacts:
    paths:
    - htmlcov/
    - docs/_build/html/
52
53
    - nosetests.html
    - nosetests.xml
54
    when: always
Daniel Scheffler's avatar
Daniel Scheffler committed
55

56
57
58
59

test_styles:
  stage: test
  script:
60
    - source /root/miniconda3/bin/activate ci_env
61
62
63
64
65
66
67
68
69
    - make lint
  artifacts:
    paths:
    - tests/linting/flake8.log
    - tests/linting/pycodestyle.log
    - tests/linting/pydocstyle.log
    when: always


70
pages:  # this job must be called 'pages' to advise GitLab to upload content to GitLab Pages
Daniel Scheffler's avatar
Daniel Scheffler committed
71
72
  stage: deploy
  dependencies:
73
    - test_gms_preprocessing
Daniel Scheffler's avatar
Daniel Scheffler committed
74
  script:
75
76
77
78
    # Create the public directory
    - rm -rf public
    - mkdir public
    - mkdir -p public/doc
Daniel Scheffler's avatar
Daniel Scheffler committed
79
    - mkdir -p public/coverage
Daniel Scheffler's avatar
Daniel Scheffler committed
80
    - mkdir -p public/nosetests_reports
81

82
    # Copy over the docs
Daniel Scheffler's avatar
Daniel Scheffler committed
83
    - cp -r docs/_build/html/* public/doc/
84

85
86
    # Copy over the coverage reports
    - cp -r htmlcov/* public/coverage/
87

88
89
    # Copy over the nosetests reports
    - cp nosetests.* public/nosetests_reports/
90

91
92
93
94
95
    # 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
96
97
98
  artifacts:
    paths:
      - public
99
    expire_in: 10 days
Daniel Scheffler's avatar
Daniel Scheffler committed
100
101
  only:
    - master