.appveyor.yml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. # This CI setup provides a largely homogeneous configuration across all
  2. # major platforms (Windows, MacOS, and Linux). The aim of this test setup is
  3. # to create a "native" platform experience, using as few cross-platform
  4. # helper tools as possible.
  5. #
  6. # On Linux/Mac a virtualenv is used for testing. The effective virtual env
  7. # is available under ~/VENV.
  8. #
  9. # All workers support remote login. Login details are shown at the top of each
  10. # CI run log.
  11. #
  12. # - Linux/Mac workers (via SSH):
  13. #
  14. # - A permitted SSH key must be defined in an APPVEYOR_SSH_KEY environment
  15. # variable (via the appveyor project settings)
  16. #
  17. # - SSH login info is given in the form of: 'appveyor@67.225.164.xx -p 22xxx'
  18. #
  19. # - Login with:
  20. #
  21. # ssh -o StrictHostKeyChecking=no <LOGIN>
  22. #
  23. # - to prevent the CI run from exiting, `touch` a file named `BLOCK` in the
  24. # user HOME directory (current directory directly after login). The session
  25. # will run until the file is removed (or 60 min have passed)
  26. #
  27. # - Windows workers (via RDP):
  28. #
  29. # - An RDP password should be defined in an APPVEYOR_RDP_PASSWORD environment
  30. # variable (via the appveyor project settings), or a random password is used
  31. # every time
  32. #
  33. # - RDP login info is given in the form of IP:PORT
  34. #
  35. # - Login with:
  36. #
  37. # xfreerdp /cert:ignore /dynamic-resolution /u:appveyor /p:<PASSWORD> /v:<LOGIN>
  38. #
  39. # - to prevent the CI run from exiting, create a textfile named `BLOCK` on the
  40. # Desktop (a required .txt extension will be added automatically). The session
  41. # will run until the file is removed (or 60 min have passed)
  42. #
  43. # - in a terminal execute, for example, `C:\datalad_debug.bat 39` to set up the
  44. # environment to debug in a Python 3.8 session (should generally match the
  45. # respective CI run configuration).
  46. # make repository clone cheap
  47. shallow_clone: true
  48. environment:
  49. # Do not use `image` as a matrix dimension, to have fine-grained control over
  50. # what tests run on which platform
  51. # The ID variable had no impact, but sorts first in the CI run overview
  52. # an intelligible name can help to locate a specific test run
  53. matrix:
  54. # List a CI run for each platform first, to have immediate access when there
  55. # is a need for debugging
  56. # Ubuntu core tests
  57. - ID: Ubu20
  58. DTS: dataladmetadatamodel
  59. APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
  60. INSTALL_SYSPKGS: python3-virtualenv
  61. # Windows core tests
  62. - ID: WinP38
  63. DTS: dataladmetadatamodel
  64. APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
  65. # Python version specification is non-standard on windows
  66. PY: 39-x64
  67. # MacOS core tests
  68. - ID: MacP38
  69. DTS: dataladmetadatamodel
  70. APPVEYOR_BUILD_WORKER_IMAGE: macOS
  71. PY: 3.8
  72. DATALAD_LOCATIONS_SOCKETS: /Users/appveyor/DLTMP/sockets
  73. # it is OK to specify paths that may not exist for a particular test run
  74. cache:
  75. # pip cache
  76. - C:\Users\appveyor\AppData\Local\pip\Cache -> .appveyor.yml
  77. - /home/appveyor/.cache/pip -> .appveyor.yml
  78. # turn of support for MS project build support (not needed)
  79. build: off
  80. # init cannot use any components from the repo, because it runs prior to
  81. # cloning it
  82. init:
  83. # remove windows 260-char limit on path names
  84. - cmd: powershell Set-Itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name LongPathsEnabled -value 1
  85. # enable developer mode on windows
  86. # this should enable mklink without admin privileges, but it doesn't seem to work
  87. #- cmd: powershell tools\ci\appveyor_enable_windevmode.ps1
  88. # enable RDP access on windows (RDP password is in appveyor project config)
  89. # this is relatively expensive (1-2min), but very convenient to jump into any build at any time
  90. - cmd: powershell.exe iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
  91. # enable external SSH access to CI worker on all other systems
  92. # needs APPVEYOR_SSH_KEY defined in project settings (or environment)
  93. - sh: curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -
  94. # Identity setup
  95. - git config --global init.defaultBranch master
  96. - git config --global user.email "test@appveyor.land"
  97. - git config --global user.name "Appveyor Almighty"
  98. # Scratch space
  99. - cmd: md C:\DLTMP
  100. # we place the "unix" one into the user's HOME to avoid git-annex issues on MacOSX
  101. # gh-5291
  102. - sh: mkdir ~/DLTMP
  103. # and use that scratch space to get short paths in test repos
  104. # (avoiding length-limits as much as possible)
  105. - cmd: "set TMP=C:\\DLTMP"
  106. - cmd: "set TEMP=C:\\DLTMP"
  107. - sh: export TMPDIR=~/DLTMP
  108. install:
  109. # place a debug setup helper at a convenient location
  110. - cmd: copy tools\ci\appveyor_env_setup.bat C:\\datalad_debug.bat
  111. # If a particular Python version is requested, use env setup (using the
  112. # appveyor provided environments/installation). Note, these are broken
  113. # on the ubuntu images
  114. # https://help.appveyor.com/discussions/problems/28217-appveyor-ubunu-image-with-python3-lzma-module
  115. # Otherwise create a virtualenv using the default Python 3, to enable uniform
  116. # use of python/pip executables below
  117. - sh: "[ \"x$PY\" != x ] && . ${HOME}/venv${PY}/bin/activate || virtualenv -p 3 ${HOME}/dlvenv && . ${HOME}/dlvenv/bin/activate; ln -s \"$VIRTUAL_ENV\" \"${HOME}/VENV\""
  118. - cmd: "set PATH=C:\\Python%PY%;C:\\Python%PY%\\Scripts;%PATH%"
  119. # Missing system software
  120. - 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"
  121. #before_build:
  122. #
  123. build_script:
  124. - python -m pip install -r requirements.txt
  125. - python -m pip install .
  126. #after_build:
  127. #
  128. before_test:
  129. # simple call to see if the datalad metadata model is installed
  130. - python -c "import dataladmetadatamodel"
  131. test_script:
  132. # run tests on installed module, not source tree files
  133. - cmd: md __testhome__
  134. - sh: mkdir __testhome__
  135. - cd __testhome__
  136. # run test selecion (--traverse-namespace needed from Python 3.8 onwards)
  137. - cmd: python -m nose --traverse-namespace -s -v --with-coverage --cover-package=dataladmetadatamodel %DTS%
  138. - sh: python -m nose --traverse-namespace -s -v --with-coverage --cover-package=dataladmetadatamodel ${DTS}
  139. after_test:
  140. # move coverage into the project dir to make default handling applicable
  141. - cmd: move .coverage ..
  142. - sh: mv .coverage ..
  143. - cd ..
  144. # use windows codecov uploader package
  145. - cmd: choco install codecov
  146. - cmd: python -m coverage xml
  147. - cmd: codecov -f coverage.xml
  148. - sh: bash <(curl -sfS https://codecov.io/bash)
  149. #on_success:
  150. #
  151. #on_failure:
  152. #
  153. on_finish:
  154. # conditionally block the exit of a CI run for direct debugging
  155. - sh: while [ -f ~/BLOCK ]; do sleep 5; done
  156. - cmd: powershell.exe while ((Test-Path "C:\Users\\appveyor\\Desktop\\BLOCK.txt")) { Start-Sleep 5 }