forked from GFZ/arosics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
159 lines (129 loc) · 3.22 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
before_script:
- git lfs pull
stages:
- test
- deploy
- cleanup
test_arosics:
stage: test
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
script:
- source activate ci_env
# update py_tools_ds and geoarray
- mamba update py-tools-ds geoarray
- mamba install joblib>=1.3.0 # TODO remove is CI runner is rebuilt
# run tests
- make pytest
# create the docs
- make docs
artifacts:
expose_as: 'Test and coverage report'
paths:
- htmlcov/
- report.html
- docs/_build/html/
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
junit: report.xml
expire_in: 30 days
when: always
test_styles:
stage: test
script:
- source activate ci_env
- make lint
artifacts:
paths:
- tests/linting/flake8.log
- tests/linting/pycodestyle.log
- tests/linting/pydocstyle.log
when: always
test_urls:
stage: test
script:
- source activate ci_env
- pip install -U urlchecker
- make urlcheck
when: always
test_arosics_install:
stage: test
script:
- source activate
- mamba update -n base mamba conda
# create arosics environment from environment_arosics.yml
- mamba env create --name arosics_test -f tests/CI_docker/context/environment_arosics.yml
- conda activate arosics_test
# install arosics
- pip install -e .
- cd ..
- pwd
- ls
# test importability
- python -c "import arosics; print(arosics)"
- python -c "from arosics import COREG, COREG_LOCAL"
# check if dependencies are properly installed
- pip check || exit
only:
- main
pages: # this job must be called 'pages' to advise GitLab to upload content to GitLab Pages
stage: deploy
dependencies:
- test_arosics
script:
# Create the public directory
- rm -rf public
- mkdir public
- mkdir -p public/doc
- mkdir -p public/images/
- mkdir -p public/coverage
- mkdir -p public/test_reports
# Copy over the docs
- cp -r docs/_build/html/* public/doc/
- cp -r docs/images/* public/images/
# Copy over the coverage reports
- cp -r htmlcov/* public/coverage/
# Copy over the test reports
- cp report.html public/test_reports/
# Check if everything is working great
- ls -al public
- ls -al public/doc
- ls -al public/coverage
- ls -al public/test_reports
artifacts:
paths:
- public
expire_in: 30 days
only:
- main
- enhancement/improve_docs
deploy_pypi:
stage: deploy
dependencies:
- test_arosics
script:
- source activate ci_env
- pip install -U twine build
- python -m build --sdist
- twine check dist/*
- twine upload dist/* # requires creds as environment variables
only:
- /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
except:
- dev
create_github_release:
stage: deploy
dependencies:
- test_arosics
script:
- bash ./.github/create_release_from_gitlab_ci.sh # uses environment variables set in the UI
only:
- /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
except:
- dev
#rever:
# stage: deploy
# dependencies:
# - deploy_pypi
# script: