123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- # 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: 'appveyor@67.225.164.xx -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.8 session (should generally match the
- # respective CI run configuration).
- # make repository clone cheap
- shallow_clone: true
- environment:
- # 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:
- # List a CI run for each platform first, to have immediate access when there
- # is a need for debugging
- # Ubuntu core tests
- - ID: Ubu20
- DTS: dataladmetadatamodel
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
- INSTALL_SYSPKGS: python3-virtualenv
- # Windows core tests
- - ID: WinP38
- DTS: dataladmetadatamodel
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- # Python version specification is non-standard on windows
- PY: 39-x64
- # MacOS core tests
- - ID: MacP38
- DTS: dataladmetadatamodel
- APPVEYOR_BUILD_WORKER_IMAGE: macOS
- PY: 3.8
- DATALAD_LOCATIONS_SOCKETS: /Users/appveyor/DLTMP/sockets
- # 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
- # 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 init.defaultBranch master
- - git config --global user.email "test@appveyor.land"
- - git config --global user.name "Appveyor Almighty"
- # 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
- install:
- # place a debug setup helper at a convenient location
- - cmd: copy tools\ci\appveyor_env_setup.bat C:\\datalad_debug.bat
- # 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%"
- # Missing system software
- - sh: "[ -n \"$INSTALL_SYSPKGS\" ] && ( [ \"x${APPVEYOR_BUILD_WORKER_IMAGE}\" = \"xmacOS\" ] && brew install -q ${INSTALL_SYSPKGS} || sudo apt-get install --no-install-recommends -y ${INSTALL_SYSPKGS} ) || true"
- #before_build:
- #
- build_script:
- - python -m pip install -r requirements.txt
- - python -m pip install .
- #after_build:
- #
- before_test:
- # simple call to see if the datalad metadata model is installed
- - python -c "import dataladmetadatamodel"
- test_script:
- # run tests on installed module, not source tree files
- - cmd: md __testhome__
- - sh: mkdir __testhome__
- - cd __testhome__
- # run test selecion (--traverse-namespace needed from Python 3.8 onwards)
- - cmd: python -m nose --traverse-namespace -s -v --with-coverage --cover-package=dataladmetadatamodel %DTS%
- - sh: python -m nose --traverse-namespace -s -v --with-coverage --cover-package=dataladmetadatamodel ${DTS}
- after_test:
- # move coverage into the project dir to make default handling applicable
- - cmd: move .coverage ..
- - sh: mv .coverage ..
- - cd ..
- # use windows codecov uploader package
- - cmd: choco install codecov
- - cmd: python -m coverage xml
- - cmd: codecov -f coverage.xml
- - sh: bash <(curl -sfS https://codecov.io/bash)
- #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 }
|