forked from esi-neuroscience/syncopy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
198 lines (188 loc) · 5.73 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
193
194
195
196
197
198
# This is the setup for our internal CI at ESI, which runs some extra
# tests which require test data we cannot publish and/or take very long.
# It is not used by the GitHub CI.
stages:
- single
- slurm
- upload
- deploy
variables:
TEST_DIR: "$CI_PROJECT_DIR/syncopy/tests"
REL_TEST_DIR: "syncopy/tests"
intellinux:
stage: single
allow_failure: true
tags:
- deploy
only:
- master
- dev
variables:
PYTEST_ADDOPTS: "--color=yes --tb=short --verbose"
GIT_FETCH_EXTRA_FLAGS: --tags
NO_SLURM: "true"
script:
- rm -rf ~/.spy
- source $HOME/miniconda/etc/profile.d/conda.sh
- conda clean --all -y
- conda env update -f syncopy.yml --prune
- conda activate syncopy
- export PYTHONPATH=$CI_PROJECT_DIR
- pytest -ra -k 'not parallel'
- pytest -ra -k 'parallel'
powerlinux:
stage: single
allow_failure: true
tags:
- power
only:
- master
- dev
variables:
PYTEST_ADDOPTS: "--color=yes --tb=short --verbose"
GIT_FETCH_EXTRA_FLAGS: --tags
TMPDIR: /tmp
script:
- rm -rf ~/.spy
- source /opt/conda/etc/profile.d/conda.sh
- conda clean --all -y
- conda env update -f syncopy.yml --prune
- conda activate syncopy
- export PYTHONPATH=$CI_PROJECT_DIR
- pytest -ra -k 'not parallel'
- pytest -ra -k 'parallel'
intelwin:
stage: single
allow_failure: true
tags:
- windows10
only:
- master
- dev
variables:
PYTEST_ADDOPTS: "--color=yes --tb=short --verbose"
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- conda clean --all -y
- conda env update --prefix ./env -f syncopy.yml --prune
# - conda install virtualenv
# - set PYTHONPATH=%PYTHONPATH%;$CI_PROJECT_DIR
- cmd /k call conda.bat activate syncopy "&" conda list
# point tox to python from the conda env
# needs to be done only once
# - cmd /c mklink /J C:\Python38 %CONDA_PREFIX%
- conda.bat activate syncopy "&" pytest -ra -k 'not parallel' $TEST_DIR
- conda.bat activate syncopy "&" pytest -ra -k 'parallel' $TEST_DIR
m1macos:
stage: single
allow_failure: true
tags:
- macos
only:
- master
- dev
variables:
PYTEST_ADDOPTS: "--color=yes --tb=short --verbose"
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- ulimit -n 25000
- rm -rf ~/.spy
- source /opt/conda/etc/profile.d/conda.sh
- conda clean --all -y
- conda env update --name syncopy --file syncopy.yml --prune
- conda activate syncopy
#- conda install -c conda-forge importlib_resources iniconfig tblib sortedcontainers dask-jobqueue
- export PYTHONPATH=$CI_PROJECT_DIR
- pytest -ra -k 'not parallel'
- pytest -ra -k 'parallel'
slurmtest:
stage: slurm
allow_failure: true
tags:
- slurm
only:
- master
- dev
variables:
PYTEST_ADDOPTS: "--color=yes --tb=short --verbose"
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- source /opt/conda/etc/profile.d/conda.sh
- conda env update -f syncopy.yml --prune
- conda activate syncopy
- export PYTHONPATH=$CI_PROJECT_DIR
- srun -p DEV --mem=8000m pytest -ra $TEST_DIR/test_specest.py
- srun -p DEV --mem=8000m pytest -ra $TEST_DIR/test_connectivity.py
- srun -p DEV pytest -ra --ignore=$REL_TEST_DIR/test_specest.py --ignore=$REL_TEST_DIR/test_connectivity.py
slurmtest-acme:
stage: slurm
allow_failure: true
tags:
- slurm
only:
- master
- dev
variables:
PYTEST_ADDOPTS: "--color=yes --tb=short --verbose"
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- source /opt/conda/etc/profile.d/conda.sh
- conda env update -f syncopy.yml --prune
- conda activate syncopy
- conda install esi-acme=2023.4 -c conda-forge
- export PYTHONPATH=$CI_PROJECT_DIR
- srun -p DEV --mem=8000m pytest -ra $TEST_DIR/test_specest.py
- srun -p DEV --mem=8000m pytest -ra $TEST_DIR/test_connectivity.py
- srun -p DEV pytest -ra --ignore=$REL_TEST_DIR/test_specest.py --ignore=$REL_TEST_DIR/test_connectivity.py
pypitest:
stage: upload
when: manual
only:
- master
- dev
tags:
- deploy
variables:
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- rm -rf dist/
- source $HOME/miniconda/etc/profile.d/conda.sh
# get poetry with python 3.10
- conda create --yes --name syncopy-deploy python=3.10 poetry=1.5.1 -c conda-forge
- conda activate syncopy-deploy
- poetry build
# needs pypi token as env variable in GitLab CI config
- poetry config repositories.testpypi https://test.pypi.org/legacy/
- poetry config pypi-token.testpypi $TESTPYPI_SECRET
- poetry publish -r testpypi
- sleep 300
# create clean new env and install the pypitest package
- conda create --yes --name piptest python=3.10
- conda activate piptest
- conda install --yes pip
- version=$(grep 'version =' pyproject.toml | awk -F "\"" '{print $2}')
- pip --no-cache-dir install --extra-index-url https://test.pypi.org/simple esi-syncopy==$version
# move out of project dir
- cd $HOME
- python -c "import syncopy as spy"
- conda deactivate
- conda remove --yes --name piptest --all
pypideploy:
stage: deploy
when: manual
only:
- master
tags:
- deploy
variables:
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- rm -rf dist/
- source $HOME/miniconda/etc/profile.d/conda.sh
# get poetry with python 3.10
- conda create --yes --name syncopy-deploy python=3.10 poetry=1.5.1 -c conda-forge
- conda activate syncopy-deploy
- poetry build
# needs pypi credentials stored as env var PYPI_SECRET in the Gitlab CI web interface.
- poetry config pypi-token.pypi "$PYPI_SECRET"
- poetry publish