-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
174 lines (165 loc) · 4.24 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
#
# Copyright © 2023 Ernst Strüngmann Institute (ESI) for Neuroscience
# in Cooperation with Max Planck Society
#
# SPDX-License-Identifier: BSD-3-Clause
#
stages:
- tox
- slurm
- upload
- deploy
linux_x86:
stage: tox
allow_failure: true
tags:
- deploy
only:
- main
- dev
variables:
PYTEST_ADDOPTS: "--color=yes --tb=short --verbose"
GIT_FETCH_EXTRA_FLAGS: --tags
NO_SLURM: "true"
script:
- source $HOME/miniconda/etc/profile.d/conda.sh
- conda clean --all -y
- conda activate acme
- tox
linux_ppc64le:
stage: tox
allow_failure: true
tags:
- power
only:
- main
- dev
variables:
PYTEST_ADDOPTS: "--color=yes --tb=short --verbose"
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- source /opt/conda/etc/profile.d/conda.sh
- conda clean --all -y
- conda activate acme
- tox -p 0
win_x86:
stage: tox
allow_failure: true
tags:
- windows10
only:
- main
- dev
variables:
PYTEST_ADDOPTS: "--color=yes --tb=short --verbose"
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- conda init cmd.exe
- conda clean --all -y
- conda activate acme
- tox
macos_m1:
stage: tox
allow_failure: true
tags:
- macos
only:
- main
- dev
variables:
PYTEST_ADDOPTS: "--color=yes --tb=short --verbose"
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- source /opt/conda/etc/profile.d/conda.sh
- conda clean --all -y
- conda activate acme
- tox -p
slurm_x86:
stage: slurm
allow_failure: true
tags:
- slurm
only:
- main
- dev
variables:
PYTEST_ADDOPTS: "--color=yes --tb=short --verbose --cov=acme/ --cov-config=.coveragerc --cov-report=xml"
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- source /opt/conda/etc/profile.d/conda.sh
- source $HOME/.acme_codecov
- conda env update -f acme.yml --prune
- conda activate acme
- export PYTHONPATH=$CI_PROJECT_DIR
- rm -rf $CI_PROJECT_DIR/acme/__pycache__
- rm -rf $CI_PROJECT_DIR/acme/tests/__pycache__
- srun -p DEV --mem=8000m -c 1 pytest
- codecov -t ${CODECOV_TOKEN}
slurm_ppc64le:
stage: slurm
allow_failure: true
tags:
- slurm-ppc
only:
- main
- 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 acme.yml --prune
- conda activate acme
- export PYTHONPATH=$CI_PROJECT_DIR
- rm -rf $CI_PROJECT_DIR/acme/__pycache__
- rm -rf $CI_PROJECT_DIR/acme/tests/__pycache__
- srun -p E880 --mem=8000m -c 4 pytest
pypi_test:
stage: upload
only:
- main
- tags
tags:
- deploy
variables:
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- source $HOME/miniconda/etc/profile.d/conda.sh
- conda update --yes conda
- conda clean --all -y
- conda env update -f acme.yml --prune
- conda activate acme
- conda install --yes twine keyring rfc3986
- conda update --yes twine keyring rfc3986
- rm -rf dist/ build/ esi_acme.egg-info/
- python setup.py sdist bdist_wheel
- tarname="$(basename -- $(ls dist/*.tar.gz) .tar.gz)"
- version=$(sed -e 's/esi-acme-\(.*\)/\1/' <<< "$tarname")
- twine upload --repository testpypi --config-file=~/.esipypirc dist/*
- sleep 300
- conda create --yes --name piptest python=3.10
- conda activate piptest
- conda install --yes pip
- pip --no-cache-dir install --extra-index-url https://test.pypi.org/simple esi-acme==$version
- python -c "from acme import ParallelMap"
- conda deactivate
- conda remove --yes --name piptest --all
pypi_deploy:
stage: deploy
when: manual
only:
- tags
tags:
- deploy
variables:
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- source $HOME/miniconda/etc/profile.d/conda.sh
- conda update --yes conda
- conda clean --all -y
- conda activate acme
- conda install --yes twine keyring rfc3986
- conda update --yes twine keyring rfc3986
- rm -rf dist/ build/ esi_acme.egg-info/
- python setup.py sdist bdist_wheel
- twine upload --config-file=~/.esipypirc dist/*