.gitlab-ci.yml 3.28 KB
Newer Older
1
2
before_script:
  - git lfs pull
Daniel Scheffler's avatar
Daniel Scheffler committed
3
4
  - mkdir -p public/images/
  - cp -r docs/images/* public/images/
5

6

Daniel Scheffler's avatar
Daniel Scheffler committed
7
stages:
8
  - test
9
  - deploy
10
11
12
  - cleanup


13
test_arosics:
14
  stage: test
15
  script:
16
    - source /root/miniconda3/bin/activate
17
18
    - source activate ci_env
    - export GDAL_DATA=/root/miniconda3/envs/ci_env/share/gdal
19
    - export PYTHONPATH=$PYTHONPATH:/root  # /root <- directory needed later
20
    - pip install "py_tools_ds>=0.14.25"  # FIXME remove as soon as docker runner has been updated
21
    - make nosetests
22
23
    # create the docs
    - pip install sphinx_rtd_theme  # Read-the-docs theme for SPHINX documentation
24
    - pip install sphinx-autodoc-typehints
25
26
27
28
29
    - make docs
  artifacts:
    paths:
    - htmlcov/
    - docs/_build/html/
30
31
    - nosetests.html
    - nosetests.xml
32
    when: always
33

34

35
36
37
test_styles:
  stage: test
  script:
38
    - source /root/miniconda3/bin/activate
39
40
    - source activate ci_env
    - export GDAL_DATA=/root/miniconda3/envs/ci_env/share/gdal
41
    - export PYTHONPATH=$PYTHONPATH:/root  # /root <- directory needed later
42
#    - pip install "pycodestyle>=2.0.0,!=2.4.0"  # TODO remove as soon as docker runner is recreated
43
44
45
46
47
48
49
50
51
    - make lint
  artifacts:
    paths:
    - tests/linting/flake8.log
    - tests/linting/pycodestyle.log
    - tests/linting/pydocstyle.log
    when: always


52
53
54
test_arosics_install:
  stage: test
  script:
55
    - source /root/miniconda3/bin/activate
56
57
    - conda create -y -q --name arosics_testinstall python=3
    - source activate arosics_testinstall
Daniel Scheffler's avatar
Daniel Scheffler committed
58
     # resolve some requirements with conda
59
    - conda install --yes -q -c conda-forge numpy gdal scikit-image matplotlib pyproj shapely geopandas pandas
60
    - conda install --yes -q -c conda-forge libgdal ncurses # Fix for libgdal installed from defaults channel causing libkea.so.1.4.7: cannot open shared object file: No such file or directory
61
    # run installer
62
    - python setup.py install
63
    # test if its importable
64
65
66
67
68
    - cd ..
    - pwd
    - ls
    - python -c "import arosics; print(arosics)"
    - python -c "from arosics import COREG, COREG_LOCAL"
69
70
  only:
    - master
71
72


73
pages:  # this job must be called 'pages' to advise GitLab to upload content to GitLab Pages
74
  stage: deploy
75
76
77
  dependencies:
    - test_arosics
  script:
78
    # Create the public directory
79
80
81
    - rm -rf public
    - mkdir public
    - mkdir -p public/doc
82
    - mkdir -p public/images/
83
    - mkdir -p public/coverage
84
    - mkdir -p public/nosetests_reports
85
    # Copy over the docs
86
    - cp -r docs/_build/html/* public/doc/
87
    - cp -r docs/images/* public/images/
88
89
90
91
92
93
94
    # 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
95
96
    - ls -al public/coverage
    - ls -al public/nosetests_reports
97
98
99
100
101
102
  artifacts:
    paths:
      - public
    expire_in: 30 days
  only:
    - master
103
    - enhancement/improve_docs
104

Daniel Scheffler's avatar
Daniel Scheffler committed
105

Daniel Scheffler's avatar
Daniel Scheffler committed
106
deploy_pypi:
107
  stage: deploy
Daniel Scheffler's avatar
Daniel Scheffler committed
108
109
  dependencies:
    - test_arosics
110
  script:
111
    - source /root/miniconda3/bin/activate
112
    - source activate ci_env
113
114
    - pip install -U twine
    - python setup.py sdist
115
    - twine upload dist/*  # requires creds as environment variables
116
117
118
119
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - dev