-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
141 lines (134 loc) · 3.72 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
#
# Copyright © 2025 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
script:
- source $HOME/miniconda/etc/profile.d/conda.sh
- conda clean --all -y
- conda env update -f acme.yml --prune
- 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 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__
- pytest
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 clean --all -y
- 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 -u -n 1 -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 clean --all -y
- 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 -u -n 1 -p E880 --mem=8000m -c 4 pytest
pypi_test:
stage: upload
only:
- main
tags:
- deploy
variables:
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- source $HOME/miniconda/etc/profile.d/conda.sh
- 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
- pyver=$(python --version | awk '{print $2}')
- conda create --yes --name piptest python=$pyver
- 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:
- main
tags:
- deploy
variables:
GIT_FETCH_EXTRA_FLAGS: --tags
script:
- source $HOME/miniconda/etc/profile.d/conda.sh
- conda activate acme
- rm -rf dist/ build/ esi_acme.egg-info/
- python setup.py sdist bdist_wheel
- twine upload --config-file=~/.esipypirc dist/*