.gitlab-ci.yml 3.22 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
Daniel Scheffler's avatar
Daniel Scheffler committed
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
test_arosics_install:
  stage: test
  script:
54
    - source /root/miniconda3/bin/activate
55
56

    # update conda and python
57
    - conda update -n base -c conda-forge conda
58
    # - conda update -c conda-forge python
59
60
61

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

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

67
    # run installer
68
    - python setup.py install
69

70
    # test if its importable
71
72
73
74
75
    - cd ..
    - pwd
    - ls
    - python -c "import arosics; print(arosics)"
    - python -c "from arosics import COREG, COREG_LOCAL"
76
77
  only:
    - master
78
79


80
pages:  # this job must be called 'pages' to advise GitLab to upload content to GitLab Pages
81
  stage: deploy
82
83
84
  dependencies:
    - test_arosics
  script:
85
    # Create the public directory
86
87
88
    - rm -rf public
    - mkdir public
    - mkdir -p public/doc
89
    - mkdir -p public/images/
90
    - mkdir -p public/coverage
91
    - mkdir -p public/nosetests_reports
92

93
    # Copy over the docs
94
    - cp -r docs/_build/html/* public/doc/
95
    - cp -r docs/images/* public/images/
96

97
98
    # Copy over the coverage reports
    - cp -r htmlcov/* public/coverage/
99

100
101
    # Copy over the nosetests reports
    - cp nosetests.* public/nosetests_reports/
102

103
104
105
    # Check if everything is working great
    - ls -al public
    - ls -al public/doc
106
107
    - ls -al public/coverage
    - ls -al public/nosetests_reports
108
109
110
111
112
113
  artifacts:
    paths:
      - public
    expire_in: 30 days
  only:
    - master
114
    - enhancement/improve_docs
115

Daniel Scheffler's avatar
Daniel Scheffler committed
116

Daniel Scheffler's avatar
Daniel Scheffler committed
117
deploy_pypi:
118
  stage: deploy
Daniel Scheffler's avatar
Daniel Scheffler committed
119
120
  dependencies:
    - test_arosics
121
  script:
122
    - source /root/miniconda3/bin/activate ci_env
123
124
    - pip install -U twine
    - python setup.py sdist
125
    - twine upload dist/*  # requires creds as environment variables
126
127
128
129
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - dev
130
131
132
133
134
135
136


create_github_release:
    stage: deploy
    dependencies:
        - test_arosics
    script:
137
        - bash ./.github/create_release_from_gitlab_ci.sh  # uses environment variables set in the UI
138
139
    only:
        - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
140
141
    except:
        - dev