.gitlab-ci.yml 3.45 KB
Newer Older
1
2
3
before_script:
  - git lfs pull

4

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


11
test_arosics:
12
  stage: test
13
  script:
14
    - source /root/miniconda3/bin/activate ci_env
15

16
17
    - conda install -c conda-forge cartopy  # FIXME remove as soon as docker container is rebuilt

18
    # update py_tools_ds and geoarray
19
    - pip install "py_tools_ds>=0.15.10"
20
    - pip install "geoarray>=0.9.0"
21
22

    # run tests
23
    - make nosetests
24

25
26
    # create the docs
    - pip install sphinx_rtd_theme  # Read-the-docs theme for SPHINX documentation
27
    - pip install sphinx-autodoc-typehints
28
29
30
31
32
    - make docs
  artifacts:
    paths:
    - htmlcov/
    - docs/_build/html/
33
34
    - nosetests.html
    - nosetests.xml
35
    when: always
36

37

38
39
40
test_styles:
  stage: test
  script:
41
    - source /root/miniconda3/bin/activate ci_env
42
43
44
45
46
47
48
49
50
    - make lint
  artifacts:
    paths:
    - tests/linting/flake8.log
    - tests/linting/pycodestyle.log
    - tests/linting/pydocstyle.log
    when: always


51
52
53
54
55
56
57
58
59
test_urls:
  stage: test
  script:
    - source /root/miniconda3/bin/activate ci_env
    - pip install -U urlchecker
    - make urlcheck
  when: always


60
61
62
test_arosics_install:
  stage: test
  script:
63
    - source /root/miniconda3/bin/activate
64
65

    # update conda and python
66
    - conda update -n base -c conda-forge conda
67
    # - conda update -c conda-forge python
68
69
70

    # create arosics environment
    - conda create -y -q -c conda-forge --name arosics_testinstall python=3
71
    - conda activate arosics_testinstall
72

Daniel Scheffler's avatar
Daniel Scheffler committed
73
     # resolve some requirements with conda
74
    - conda install --yes -q -c conda-forge numpy gdal scikit-image matplotlib 'pyproj>2.2.0' shapely geopandas pandas pykrige pyfftw cartopy
75

76
    # run installer
77
    - python setup.py install
78

79
    # test if its importable
80
81
82
83
84
    - cd ..
    - pwd
    - ls
    - python -c "import arosics; print(arosics)"
    - python -c "from arosics import COREG, COREG_LOCAL"
85
86
  only:
    - master
87
88


89
pages:  # this job must be called 'pages' to advise GitLab to upload content to GitLab Pages
90
  stage: deploy
91
92
93
  dependencies:
    - test_arosics
  script:
94
    # Create the public directory
95
96
97
    - rm -rf public
    - mkdir public
    - mkdir -p public/doc
98
    - mkdir -p public/images/
99
    - mkdir -p public/coverage
100
    - mkdir -p public/nosetests_reports
101

102
    # Copy over the docs
103
    - cp -r docs/_build/html/* public/doc/
104
    - cp -r docs/images/* public/images/
105

106
107
    # Copy over the coverage reports
    - cp -r htmlcov/* public/coverage/
108

109
110
    # Copy over the nosetests reports
    - cp nosetests.* public/nosetests_reports/
111

112
113
114
    # Check if everything is working great
    - ls -al public
    - ls -al public/doc
115
116
    - ls -al public/coverage
    - ls -al public/nosetests_reports
117
118
119
120
121
122
  artifacts:
    paths:
      - public
    expire_in: 30 days
  only:
    - master
123
    - enhancement/improve_docs
124

Daniel Scheffler's avatar
Daniel Scheffler committed
125

Daniel Scheffler's avatar
Daniel Scheffler committed
126
deploy_pypi:
127
  stage: deploy
Daniel Scheffler's avatar
Daniel Scheffler committed
128
129
  dependencies:
    - test_arosics
130
  script:
131
    - source /root/miniconda3/bin/activate ci_env
132
133
    - pip install -U twine
    - python setup.py sdist
134
    - twine upload dist/*  # requires creds as environment variables
135
136
137
138
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - dev
139
140
141
142
143
144
145


create_github_release:
    stage: deploy
    dependencies:
        - test_arosics
    script:
146
        - bash ./.github/create_release_from_gitlab_ci.sh  # uses environment variables set in the UI
147
148
    only:
        - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
149
150
    except:
        - dev
151
152


Daniel Scheffler's avatar
Daniel Scheffler committed
153
154
155
156
157
#rever:
#    stage: deploy
#    dependencies:
#        - deploy_pypi
#    script: