-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
192 lines (171 loc) · 5.19 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# This script is an edited version of the example found at
# https://git.ligo.org/lscsoft/example-ci-project/blob/python/.gitlab-ci.yml
# Each 0th-indendation level is a job that will be run within GitLab CI
# The only exception are a short list of reserved keywords
#
# https://docs.gitlab.com/ee/ci/yaml/#gitlab-ci-yml
# stages is a reserved keyword that defines job dependencies and
# parallelization. each stage runs in parallel but must complete
# before the next stage begins
# This file was copied from bilby_pipe
stages:
- initial
- test
- documentation
- deploy
.basic-python: &basic-python
stage: initial
image: python
before_script:
- pip install --upgrade pip
script:
- pip install --ignore-installed .
- cd ..
- python -c "import pygwb"
- python -c "import pygwb.baseline"
- python -c "import pygwb.constants"
- python -c "import pygwb.delta_sigma_cut"
- python -c "import pygwb.detector"
- python -c "import pygwb.network"
- python -c "import pygwb.notch"
- python -c "import pygwb.orfs"
- python -c "import pygwb.parameters"
- python -c "import pygwb.pe"
- python -c "import pygwb.postprocessing"
- python -c "import pygwb.preprocessing"
- python -c "import pygwb.simulator"
- python -c "import pygwb.spectral"
- python -c "import pygwb.statistical_checks"
- python -c "import pygwb.util"
- for script in $(pip show -f pygwb | grep "bin\/" | xargs -I {} basename {}); do
${script} --help;
done
.basic-python-38: &basic-python-38
stage: initial
image: python
before_script:
- pip install --upgrade pip
script:
- pip install --ignore-installed .
- pip install gwsumm==2.0.1 # have to fix these to continue using py38 due to backwards-incompatible changes in gwsumm/gwpy; should deprecate py38 soon.
- pip install lscsoft-glue==3.0.1
- cd ..
- python -c "import pygwb"
- python -c "import pygwb.baseline"
- python -c "import pygwb.constants"
- python -c "import pygwb.delta_sigma_cut"
- python -c "import pygwb.detector"
- python -c "import pygwb.network"
- python -c "import pygwb.notch"
- python -c "import pygwb.orfs"
- python -c "import pygwb.parameters"
- python -c "import pygwb.pe"
- python -c "import pygwb.postprocessing"
- python -c "import pygwb.preprocessing"
- python -c "import pygwb.simulator"
- python -c "import pygwb.spectral"
- python -c "import pygwb.statistical_checks"
- python -c "import pygwb.util"
- for script in $(pip show -f pygwb | grep "bin\/" | xargs -I {} basename {}); do
${script} --help;
done
basic-3.8:
<<: *basic-python-38
image: python:3.8
basic-3.9:
<<: *basic-python
image: python:3.9
basic-3.10:
<<: *basic-python
image: python:3.10
.precommits-python: &precommits-python
stage: initial
image: python
script:
- pip install --upgrade pip
- pip install .
- pip install pre-commit
# Run precommits (black, flake8, spellcheck, isort, no merge conflicts, etc)
- pre-commit run --files pygwb/*.py --verbose --show-diff-on-failure
- pre-commit run --files pygwb_pipe/*.py --verbose --show-diff-on-failure
- pre-commit run --files test/*.py --verbose --show-diff-on-failure
- pre-commit run --files tutorials/*.py --verbose --show-diff-on-failure
- pre-commit run --files *.py --verbose --show-diff-on-failure
precommits-py3.8:
<<: *precommits-python
image: python:3.8
.test-python: &test-python
stage: test
image: python
before_script:
- pip install --upgrade pip setuptools
- pip install pytest pytest-cov coverage-badge
script:
- pip install .
- pytest --cov=pygwb --cov-config=.coveragerc
python-3.8:
<<: *test-python
image: python:3.8
after_script:
- coverage html
- coverage xml
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
paths:
- htmlcov/
expire_in: 30 days
python-3.9:
<<: *test-python
image: python:3.9
python-3.10:
<<: *test-python
image: python:3.10
workflow:
stage: test
image: python:3.10
before_script:
- pip install --upgrade pip setuptools
script:
- pip install .
- mkdir workflow_result
- pygwb_create_isotropic_workflow --configfile ./test/test_data/config_workflow_test.ini --basedir ./workflow_result/ --run_locally
documentation:
stage: documentation
image: python:3.8
before_script:
- apt-get -yqq update
- apt-get -yqq install pandoc
- pip install --upgrade pip setuptools
- pip install ipykernel ipython==8.12.0 jupyter
- pip install sphinx numpydoc nbsphinx sphinx_rtd_theme sphinx-tabs autodoc ipython-genutils
- pip install .
script:
- cd docs
- cp ../tutorials/*.ipynb ./
- cp ../tutorials/*.dat ./
- cp -r ../tutorials/input ./
- make clean
- make html
- cd -
artifacts:
paths:
- docs/_build
pages:
stage: deploy
dependencies:
- python-3.8
- documentation
script:
- mkdir public/
- mv htmlcov/ public/
- mv docs/_build/html/* public/
artifacts:
paths:
- public
expire_in: 30 days
only:
- master