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

    # update py_tools_ds and geoarray
    # - pip install "py_tools_ds>=0.14.28"
    # - pip install "geoarray>=0.8.30"
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
test_arosics_install:
  stage: test
  script:
52
    - source /root/miniconda3/bin/activate
53
54

    # update conda and python
55
    - conda update -n base -c conda-forge conda
56
    # - conda update -c conda-forge python
57
58
59

    # create arosics environment
    - conda create -y -q -c conda-forge --name arosics_testinstall python=3
60
    - source activate arosics_testinstall
61

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

65
    # run installer
66
    - python setup.py install
67

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


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

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

95
96
    # Copy over the coverage reports
    - cp -r htmlcov/* public/coverage/
97

98
99
    # Copy over the nosetests reports
    - cp nosetests.* public/nosetests_reports/
100

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

Daniel Scheffler's avatar
Daniel Scheffler committed
114

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


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