-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
194 lines (186 loc) · 5.47 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
variables:
GIT_SSL_NO_VERIFY: "1"
stages:
- build
- test
- deploy
# general definitions
.build: &build
stage: build
artifacts:
paths:
- bld-dir/
#conda:build:posix: &conda_build_posix
# <<: *build
# script:
# - ./tools/build.sh
#conda:build:lnx: &conda_build_lnx
# <<: *conda_build_posix
# before_script:
# - source "/opt/conda/etc/profile.d/conda.sh"
# - conda activate /opt/conda/
# - git config --global safe.directory '*'
# - git submodule update --init --recursive --remote
#
## linux conda builds
#conda:build:lnx:x86:
# <<: *conda_build_lnx
# image:
# entrypoint: [ "/bin/bash", "-i", "-c" ]
# name: condaforge/linux-anvil-cos7-x86_64
# tags:
# - linux
# - x86_64
#conda:build:lnx:ppc64le:
# <<: *conda_build_lnx
# image:
# entrypoint: [ "/bin/bash", "-i", "-c" ]
# name: condaforge/linux-anvil-ppc64le
# tags:
# - linux
# - ppc64le
#conda:build:lnx:aarch64:
# <<: *conda_build_lnx
# image:
# entrypoint: [ "/bin/bash", "-i", "-c" ]
# name: condaforge/linux-anvil-aarch64
# tags:
# - linux
# - aarch64
#
#conda:build:osx:
# <<: *conda_build_posix
# tags:
# - osx
# before_script:
# - git submodule update --init --recursive --remote
#
#conda:build:windows:
# <<: *build
# tags:
# - win
# script: |
# conda activate base
# copy /Y tools\.condarc %userprofile%
# copy /Y tools\conda_build_config.yaml conda_build_config.yaml
# mamba install -y boa doxygen cmake
# conda mambabuild conda-recipe --output-folder bld-dir
conda:test:linux:
stage: test
tags:
- local # go for a server marked as local
- linux
image: condaforge/mambaforge
# needs: ["conda:build:lnx:x86"]
needs: []
before_script:
- |
export DEBIAN_FRONTEND=interactive
export TZ=Europe/Berlin
apt-get update -qy && apt-get install -qy git nfs-common # sshfs
script:
- |
source activate base
mamba install python tttrlib nose -c tpeulen
git clone https://gitlab.peulen.xyz/skf/tttrlib && cd tttrlib && git fetch && git switch $CI_COMMIT_REF_NAME
mount.nfs -o nolock 192.168.124.254:/mnt/user/www /srv
ln -s /srv/tttr-data tttr-data
nosetests test
#conda:deploy:
# stage: deploy
# image: condaforge/mambaforge
# tags:
# - linux
# before_script:
# - git submodule update --init --recursive --remote
# script:
# - ./tools/deploy.sh
deploy:doc:
# requires runner in privileged mode (setup in config.toml)
stage: deploy
image: condaforge/mambaforge
tags:
- local
- linux
# needs: ["conda:build:lnx:x86"]
needs: []
before_script:
- |
export DEBIAN_FRONTEND=interactive
export TZ=Europe/Berlin
apt-get update -qy && apt-get install -qy git nfs-common make
script:
- conda config --add channels tpeulen # "file://`pwd`/bld-dir"
- mount.nfs -o nolock 192.168.124.254:/mnt/user/www /srv
- ln -s /srv/tttr-data tttr-data
- cd doc
- source activate base
- mamba env create -f environment.yml
- conda activate doc-tttrlib
- mamba install tttrlib --use-local
- make html
- rm -rf /srv/docs.peulen.xyz/project/$CI_PROJECT_TITLE/$CI_COMMIT_REF_NAME
- mv -v _build/html/stable /srv/docs.peulen.xyz/project/$CI_PROJECT_TITLE/$CI_COMMIT_REF_NAME
wheel:linux:
stage: build
tags:
- linux
image: python:3.8
# make a docker daemon available for cibuildwheel to use
services:
- name: docker:dind
entrypoint: ["env", "-u", "DOCKER_HOST"]
command: ["dockerd-entrypoint.sh"]
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
# See https://github.com/docker-library/docker/pull/166
DOCKER_TLS_CERTDIR: ""
script:
- curl -sSL https://get.docker.com/ | sh
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- python -m pip install cibuildwheel==2.12.1
- git submodule update --init --recursive --remote
- cibuildwheel --output-dir bld-dir --platform linux
- python -m pip install --upgrade pip
- pip install twine
- export TWINE_PASSWORD="$PYPI_TOKEN"
- if [ "$CI_COMMIT_REF_NAME" != "master" ]; then export TWINE_REPOSITORY=testpypi; export TWINE_PASSWORD="$PYPI_TEST_TOKEN"; fi
- twine upload --skip-existing bld-dir/*.whl
artifacts:
paths:
- bld-dir/
wheel:osx:
stage: build
tags:
- osx
script:
- conda deactivate
- python3 -m pip install cibuildwheel==2.12.1
- git submodule update --init --recursive --remote
- cibuildwheel --output-dir bld-dir --platform macos
- python3 -m pip install --upgrade pip
- python3 -m pip install twine
- export TWINE_PASSWORD="$PYPI_TOKEN"
- if [ "$CI_COMMIT_REF_NAME" != "master" ]; then export TWINE_REPOSITORY=testpypi; export TWINE_PASSWORD="$PYPI_TEST_TOKEN"; fi
- python3 -m twine upload --skip-existing bld-dir/*.whl
artifacts:
paths:
- bld-dir/
wheel:windows:
<<: *build
image: wheel:win
script:
- |
conda deactivate
set-content $env:public\inline.cmd -Value @'
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
py -m cibuildwheel --output-dir bld-dir --platform windows
set TWINE_PASSWORD=%PYPI_TOKEN%
if %CI_COMMIT_REF_NAME% NEQ master set TWINE_REPOSITORY=testpypi
if %CI_COMMIT_REF_NAME% NEQ master set TWINE_PASSWORD=%PYPI_TEST_TOKEN%
twine upload --skip-existing bld-dir/*.whl
'@
CMD.EXE /C $env:public\inline.cmd
tags:
- win