forked from datalad/datalad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
370 lines (329 loc) · 13.7 KB
/
.appveyor.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# This CI setup provides a largely homogeneous configuration across all
# major platforms (Windows, MacOS, and Linux). The aim of this test setup is
# to create a "native" platform experience, using as few cross-platform
# helper tools as possible.
#
# On Linux/Mac a virtualenv is used for testing. The effective virtual env
# is available under ~/VENV.
#
# All workers support remote login. Login details are shown at the top of each
# CI run log.
#
# - Linux/Mac workers (via SSH):
#
# - A permitted SSH key must be defined in an APPVEYOR_SSH_KEY environment
# variable (via the appveyor project settings)
#
# - SSH login info is given in the form of: '[email protected] -p 22xxx'
#
# - Login with:
#
# ssh -o StrictHostKeyChecking=no <LOGIN>
#
# - to prevent the CI run from exiting, `touch` a file named `BLOCK` in the
# user HOME directory (current directory directly after login). The session
# will run until the file is removed (or 60 min have passed)
#
# - Windows workers (via RDP):
#
# - An RDP password should be defined in an APPVEYOR_RDP_PASSWORD environment
# variable (via the appveyor project settings), or a random password is used
# every time
#
# - RDP login info is given in the form of IP:PORT
#
# - Login with:
#
# xfreerdp /cert:ignore /dynamic-resolution /u:appveyor /p:<PASSWORD> /v:<LOGIN>
#
# - to prevent the CI run from exiting, create a textfile named `BLOCK` on the
# Desktop (a required .txt extension will be added automatically). The session
# will run until the file is removed (or 60 min have passed)
#
# - in a terminal execute, for example, `C:\datalad_debug.bat 39` to set up the
# environment to debug in a Python 3.9 session (should generally match the
# respective CI run configuration).
#
# - Workers have vim installed for convenient text editing in the command shell
# do not make repository clone cheap: interfers with versioneer
shallow_clone: false
environment:
DATALAD_TESTS_SSH: 1
# Do not use `image` as a matrix dimension, to have fine-grained control over
# what tests run on which platform
# The ID variable had no impact, but sorts first in the CI run overview
# an intelligible name can help to locate a specific test run
matrix:
## going for ~30min CI job duration to leave ample time for debugging and
## get fast turn around via multi-job parallelization
# List a CI run for each platform first, to have immediate access when there
# is a need for debugging
# Ubuntu core tests
- ID: Ubu20core
# ~30min
DTS: >
datalad.cli
datalad.core
datalad.customremotes
datalad.dataset
datalad.distributed
datalad.distribution
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
INSTALL_SYSPKGS: python3-virtualenv
CODECOV_BINARY: https://uploader.codecov.io/latest/linux/codecov
# system git-annex is way too old, use better one
INSTALL_GITANNEX: git-annex -m deb-url --url https://datasets.datalad.org/datalad/packages/neurodebian/git-annex_8.20210903-1_amd64.deb
# Windows core tests
- ID: WinP39core
# ~35 min
DTS: datalad.core datalad.dataset datalad.runner
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
# Python version specification is non-standard on windows
PY: 39-x64
# TODO: use datalad/git-annex (github release packages) but
# it would need setup of a GITHUB_TOKEN to access.
# This one is set in master but kept without change in maint for now
# INSTALL_GITANNEX: git-annex -m datalad/packages
# MacOS core tests
- ID: MacP38core
# ~40min
DTS: datalad.core datalad.dataset datalad.runner datalad.support
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
PY: 3.8
# does not give a functional installation
# INSTALL_GITANNEX: git-annex -m snapshot
#INSTALL_GITANNEX: git-annex=8.20201129
INSTALL_GITANNEX: git-annex
DATALAD_LOCATIONS_SOCKETS: /Users/appveyor/DLTMP/sockets
CODECOV_BINARY: https://uploader.codecov.io/latest/macos/codecov
# Additional test runs
- ID: Ubu20a1
# ~30min
DTS: >
datalad.downloaders
datalad.interface
datalad.local
datalad.runner
datalad.support
datalad.tests
datalad.ui
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
INSTALL_SYSPKGS: python3-virtualenv
CODECOV_BINARY: https://uploader.codecov.io/latest/linux/codecov
# system git-annex is way too old, use better one
INSTALL_GITANNEX: git-annex -m deb-url --url https://datasets.datalad.org/datalad/packages/neurodebian/git-annex_8.20210903-1_amd64.deb
- ID: WinP39a1
# ~40min
DTS: >
datalad.cli
datalad.customremotes
datalad.distribution
datalad.distributed
datalad.downloaders
datalad.interface
datalad.tests
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
PY: 39-x64
- ID: WinP39a2
# ~45min
DTS: >
datalad.local
datalad.support
datalad.ui
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
PY: 39-x64
- ID: MacP38a1
# ~40min
DTS: >
datalad.cli
datalad.customremotes
datalad.distribution
datalad.downloaders
datalad.interface
datalad.tests
datalad.ui
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
PY: 3.8
INSTALL_GITANNEX: git-annex
DATALAD_LOCATIONS_SOCKETS: /Users/appveyor/DLTMP/sockets
CODECOV_BINARY: https://uploader.codecov.io/latest/macos/codecov
- ID: MacP38a2
# ~40min
DTS: >
datalad.local
datalad.distributed
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
PY: 3.8
INSTALL_GITANNEX: git-annex
DATALAD_LOCATIONS_SOCKETS: /Users/appveyor/DLTMP/sockets
CODECOV_BINARY: https://uploader.codecov.io/latest/macos/codecov
# Test alternative Python versions
- ID: Ubu20P37a
# ~35min
PY: 3.7
DTS: >
datalad.cli
datalad.core
datalad.customremotes
datalad.dataset
datalad.distributed
datalad.distribution
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
INSTALL_SYSPKGS: python3-virtualenv
CODECOV_BINARY: https://uploader.codecov.io/latest/linux/codecov
# system git-annex is way too old, use better one
INSTALL_GITANNEX: git-annex -m deb-url --url https://datasets.datalad.org/datalad/packages/neurodebian/git-annex_8.20210903-1_amd64.deb
- ID: Ubu20P37b
# ~25min
PY: 3.7
DTS: >
datalad.downloaders
datalad.interface
datalad.local
datalad.runner
datalad.support
datalad.tests
datalad.ui
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
INSTALL_SYSPKGS: python3-virtualenv
CODECOV_BINARY: https://uploader.codecov.io/latest/linux/codecov
# system git-annex is way too old, use better one
INSTALL_GITANNEX: git-annex -m deb-url --url https://datasets.datalad.org/datalad/packages/neurodebian/git-annex_8.20210903-1_amd64.deb
matrix:
allow_failures:
- KNOWN2FAIL: 1
# do not run the CI if only documentation changes were made
# documentation builds are tested elsewhere and cheaper
skip_commits:
files:
- docs/
# tests need specific hostnames to be available
# note, this is insufficient on MacOS, and needs to be reflected
# in the SSH config too (tools/ci/appveyor_ssh_config)
hosts:
datalad-test: 127.0.0.1
datalad-test2: 127.0.0.1
# it is OK to specify paths that may not exist for a particular test run
cache:
# pip cache
- C:\Users\appveyor\AppData\Local\pip\Cache -> .appveyor.yml
- /home/appveyor/.cache/pip -> .appveyor.yml
# TODO: where is the cache on macOS?
#- /Users/appveyor/.cache/pip -> .appveyor.yml
# TODO: Can we cache `brew`?
#- /usr/local/Cellar
#- /usr/local/bin
# turn of support for MS project build support (not needed)
build: off
# init cannot use any components from the repo, because it runs prior to
# cloning it
init:
# remove windows 260-char limit on path names
- cmd: powershell Set-Itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name LongPathsEnabled -value 1
# enable developer mode on windows
# this should enable mklink without admin privileges, but it doesn't seem to work
#- cmd: powershell tools\ci\appveyor_enable_windevmode.ps1
# enable RDP access on windows (RDP password is in appveyor project config)
# this is relatively expensive (1-2min), but very convenient to jump into any build at any time
- cmd: powershell.exe iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# enable external SSH access to CI worker on all other systems
# needs APPVEYOR_SSH_KEY defined in project settings (or environment)
- sh: curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -
# Identity setup
- git config --global user.email "[email protected]"
- git config --global user.name "Appveyor Almighty"
# globally setting filter.annex.process (needs git-annex 8.20211117) to reduce git-add runtime
# https://git-annex.branchable.com/bugs/Windows__58___substantial_per-file_cost_for___96__add__96__/
- cmd: git config --system filter.annex.process "git-annex filter-process"
# might also bring a slight speed-up on Mac, but Ubuntu git-annex is currently too old
#- sh: sudo git config --system filter.annex.process "git-annex filter-process"
# Scratch space
- cmd: md C:\DLTMP
# we place the "unix" one into the user's HOME to avoid git-annex issues on MacOSX
# gh-5291
- sh: mkdir ~/DLTMP
# and use that scratch space to get short paths in test repos
# (avoiding length-limits as much as possible)
- cmd: "set TMP=C:\\DLTMP"
- cmd: "set TEMP=C:\\DLTMP"
- sh: export TMPDIR=~/DLTMP
# Temporary keys for localhost access in default place
- cmd: ssh-keygen -f C:\Users\appveyor\.ssh\id_rsa -N ""
- sh: ssh-keygen -f ~/.ssh/id_rsa -N ""
# Remove AppVeyor's known_hosts entries for gitlab, since they are matching
# `*` as the IP (see https://github.com/appveyor/ci/issues/3792)
- cmd: ssh-keygen -f C:\Users\appveyor\.ssh\known_hosts -R "gitlab.com"
- sh: ssh-keygen -f ~/.ssh/known_hosts -R "gitlab.com"
install:
# place a debug setup helper at a convenient location
- cmd: copy tools\ci\appveyor_env_setup.bat C:\\datalad_debug.bat
# deploy standard SSH config for localhost access on Windows
- cmd: tools\ci\appveyor_ssh2localhost.bat
- sh: sh tools/ci/appveyor_ssh2localhost.sh
# If a particular Python version is requested, use env setup (using the
# appveyor provided environments/installation). Note, these are broken
# on the ubuntu images
# https://help.appveyor.com/discussions/problems/28217-appveyor-ubunu-image-with-python3-lzma-module
# Otherwise create a virtualenv using the default Python 3, to enable uniform
# use of python/pip executables below
- sh: "[ \"x$PY\" != x ] && . ${HOME}/venv${PY}/bin/activate || virtualenv -p 3 ${HOME}/dlvenv && . ${HOME}/dlvenv/bin/activate; ln -s \"$VIRTUAL_ENV\" \"${HOME}/VENV\""
- cmd: "set PATH=C:\\Python%PY%;C:\\Python%PY%\\Scripts;%PATH%"
# Workaround on older/buggy debian/ubuntus having outdated certificate
- sh: tools/ci/debians_disable_outdated_ssl_cert
# Deploy test root CA for internal HTTPS test server
- sh: tools/ci/deploy_datalad-rootca
# deploy the datalad installer, override version via DATALAD_INSTALLER_VERSION
- cmd:
IF DEFINED DATALAD_INSTALLER_VERSION (
python -m pip install "datalad-installer%DATALAD_INSTALLER_VERSION%"
) ELSE (
python -m pip install datalad-installer
)
- sh: python -m pip install datalad-installer${DATALAD_INSTALLER_VERSION:-}
# Missing system software
- sh: "[ -n \"$INSTALL_SYSPKGS\" ] && ( [ \"x${APPVEYOR_BUILD_WORKER_IMAGE}\" = \"xmacOS\" ] && brew install -q ${INSTALL_SYSPKGS} || { sudo apt-get update -y && sudo apt-get install --no-install-recommends -y ${INSTALL_SYSPKGS}; } ) || true"
# Install git-annex on windows, otherwise INSTALL_SYSPKGS can be used
# deploy git-annex, if desired
- cmd: IF DEFINED INSTALL_GITANNEX datalad-installer --sudo ok %INSTALL_GITANNEX%
- sh: "[ -n \"${INSTALL_GITANNEX}\" ] && datalad-installer --sudo ok ${INSTALL_GITANNEX}"
# TODO remove when datalad-installer can handle this
- cmd: tools\ci\appveyor_install_git-annex.bat
#before_build:
#
build_script:
#- python -m pip install ".[tests]"
#- python -m pip install ".[devel-utils]"
# make comprehensive approach used by travis setup
- pip install -r requirements-devel.txt
#after_build:
#
before_test:
# test SSH login
- ssh -v localhost exit
- ssh datalad-test exit
- ssh datalad-test2 exit
- datalad wtf
test_script:
# run tests on installed module, not source tree files
- cmd: md __testhome__
- sh: mkdir __testhome__
- cd __testhome__
# run test selection
- cmd: python -m pytest -c ../tox.ini -n 2 -s -v -m "not (turtle)" --cov=datalad --pyargs %DTS%
- sh: PATH=$PWD/../tools/coverage-bin:$PATH python -m pytest -c ../tox.ini -n 2 -s -v -m "not (turtle)" --cov=datalad --pyargs ${DTS}
after_test:
- sh: python -m coverage combine -a /tmp/.coverage-entrypoints-*;
- python -m coverage xml
- cmd: curl -fsSL -o codecov.exe "https://uploader.codecov.io/latest/windows/codecov.exe"
- cmd: .\codecov.exe -f "coverage.xml"
- sh: "curl -Os $CODECOV_BINARY"
- sh: chmod +x codecov
- sh: ./codecov
#on_success:
#
#on_failure:
#
on_finish:
# conditionally block the exit of a CI run for direct debugging
- sh: while [ -f ~/BLOCK ]; do sleep 5; done
- cmd: powershell.exe while ((Test-Path "C:\Users\\appveyor\\Desktop\\BLOCK.txt")) { Start-Sleep 5 }