.gitlab-ci.yml 3.38 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

    # update py_tools_ds and geoarray
17
    - conda update -y -q -c conda-forge py-tools-ds
18
    - conda update -y -q -c conda-forge geoarray
19
20

    # run tests
21
    - make nosetests
22

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

35

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


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


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

    # update conda and python
64
    - conda update -n base -c conda-forge conda
65
    # - conda update -c conda-forge python
66
67
68

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

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

74
    # run installer
75
    - python setup.py install
76

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


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

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

104
105
    # Copy over the coverage reports
    - cp -r htmlcov/* public/coverage/
106

107
108
    # Copy over the nosetests reports
    - cp nosetests.* public/nosetests_reports/
109

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

Daniel Scheffler's avatar
Daniel Scheffler committed
123

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


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


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