.appveyor.yml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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. # do not make repository clone cheap: interfers with versioneer
  47. shallow_clone: false
  48. environment:
  49. DATALAD_TESTS_SSH: 1
  50. # Do not use `image` as a matrix dimension, to have fine-grained control over
  51. # what tests run on which platform
  52. # The ID variable had no impact, but sorts first in the CI run overview
  53. # an intelligible name can help to locate a specific test run
  54. matrix:
  55. # List a CI run for each platform first, to have immediate access when there
  56. # is a need for debugging
  57. # Ubuntu core tests
  58. - ID: Ubu20
  59. DTS: datalad_gooey
  60. APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
  61. INSTALL_SYSPKGS: python3-virtualenv
  62. # system git-annex is way too old, use better one
  63. INSTALL_GITANNEX: git-annex -m deb-url --url http://snapshot.debian.org/archive/debian/20210906T204127Z/pool/main/g/git-annex/git-annex_8.20210903-1_amd64.deb
  64. CODECOV_BINARY: https://uploader.codecov.io/latest/linux/codecov
  65. # Windows core tests
  66. - ID: WinP39core
  67. # ~35 min
  68. DTS: datalad_gooey
  69. APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
  70. # Python version specification is non-standard on windows
  71. PY: 39-x64
  72. INSTALL_GITANNEX: git-annex -m datalad/packages
  73. # MacOS core tests
  74. - ID: MacP38core
  75. DTS: datalad_gooey
  76. APPVEYOR_BUILD_WORKER_IMAGE: macOS
  77. PY: 3.8
  78. INSTALL_GITANNEX: git-annex
  79. DATALAD_LOCATIONS_SOCKETS: /Users/appveyor/DLTMP/sockets
  80. CODECOV_BINARY: https://uploader.codecov.io/latest/macos/codecov
  81. matrix:
  82. allow_failures:
  83. - KNOWN2FAIL: 1
  84. # do not run the CI if only documentation changes were made
  85. # documentation builds are tested elsewhere and cheaper
  86. skip_commits:
  87. files:
  88. - docs/
  89. # it is OK to specify paths that may not exist for a particular test run
  90. cache:
  91. # pip cache
  92. - C:\Users\appveyor\AppData\Local\pip\Cache -> .appveyor.yml
  93. - /home/appveyor/.cache/pip -> .appveyor.yml
  94. # TODO: where is the cache on macOS?
  95. #- /Users/appveyor/.cache/pip -> .appveyor.yml
  96. # TODO: Can we cache `brew`?
  97. #- /usr/local/Cellar
  98. #- /usr/local/bin
  99. # turn of support for MS project build support (not needed)
  100. build: off
  101. # init cannot use any components from the repo, because it runs prior to
  102. # cloning it
  103. init:
  104. # remove windows 260-char limit on path names
  105. - cmd: powershell Set-Itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name LongPathsEnabled -value 1
  106. # enable developer mode on windows
  107. # this should enable mklink without admin privileges, but it doesn't seem to work
  108. #- cmd: powershell tools\ci\appveyor_enable_windevmode.ps1
  109. # enable RDP access on windows (RDP password is in appveyor project config)
  110. # this is relatively expensive (1-2min), but very convenient to jump into any build at any time
  111. - cmd: powershell.exe iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
  112. # enable external SSH access to CI worker on all other systems
  113. # needs APPVEYOR_SSH_KEY defined in project settings (or environment)
  114. - sh: curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -
  115. # Identity setup
  116. - git config --global user.email "test@appveyor.land"
  117. - git config --global user.name "Appveyor Almighty"
  118. # Scratch space
  119. - cmd: md C:\DLTMP
  120. # we place the "unix" one into the user's HOME to avoid git-annex issues on MacOSX
  121. # gh-5291
  122. - sh: mkdir ~/DLTMP
  123. # and use that scratch space to get short paths in test repos
  124. # (avoiding length-limits as much as possible)
  125. - cmd: "set TMP=C:\\DLTMP"
  126. - cmd: "set TEMP=C:\\DLTMP"
  127. - sh: export TMPDIR=~/DLTMP
  128. install:
  129. # place a debug setup helper at a convenient location
  130. - cmd: copy tools\ci\appveyor_env_setup.bat C:\\datalad_debug.bat
  131. # If a particular Python version is requested, use env setup (using the
  132. # appveyor provided environments/installation). Note, these are broken
  133. # on the ubuntu images
  134. # https://help.appveyor.com/discussions/problems/28217-appveyor-ubunu-image-with-python3-lzma-module
  135. # Otherwise create a virtualenv using the default Python 3, to enable uniform
  136. # use of python/pip executables below
  137. - sh: "[ \"x$PY\" != x ] && . ${HOME}/venv${PY}/bin/activate || virtualenv -p 3 ${HOME}/dlvenv && . ${HOME}/dlvenv/bin/activate; ln -s \"$VIRTUAL_ENV\" \"${HOME}/VENV\""
  138. - cmd: "set PATH=C:\\Python%PY%;C:\\Python%PY%\\Scripts;%PATH%"
  139. # deploy the datalad installer, override version via DATALAD_INSTALLER_VERSION
  140. - cmd:
  141. IF DEFINED DATALAD_INSTALLER_VERSION (
  142. python -m pip install "datalad-installer%DATALAD_INSTALLER_VERSION%"
  143. ) ELSE (
  144. python -m pip install datalad-installer
  145. )
  146. - sh: python -m pip install datalad-installer${DATALAD_INSTALLER_VERSION:-}
  147. # Missing system software
  148. - 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"
  149. # Install git-annex on windows, otherwise INSTALL_SYSPKGS can be used
  150. # deploy git-annex, if desired
  151. - cmd: IF DEFINED INSTALL_GITANNEX datalad-installer --sudo ok %INSTALL_GITANNEX%
  152. - sh: "[ -n \"${INSTALL_GITANNEX}\" ] && datalad-installer --sudo ok ${INSTALL_GITANNEX}"
  153. # in case of a snapshot installation, use the following approach to adjust
  154. # the PATH as necessary
  155. #- sh: "[ -n \"${INSTALL_GITANNEX}\" ] && datalad-installer -E ${HOME}/dlinstaller_env.sh --sudo ok ${INSTALL_GITANNEX}"
  156. # add location of datalad installer results to PATH
  157. #- sh: "[ -f ${HOME}/dlinstaller_env.sh ] && . ${HOME}/dlinstaller_env.sh || true"
  158. #before_build:
  159. #
  160. build_script:
  161. - python -m pip install -r requirements-devel.txt
  162. - python -m pip install .
  163. #after_build:
  164. #
  165. before_test:
  166. # simple call to see if datalad and git-annex are installed properly
  167. - datalad wtf
  168. test_script:
  169. # run tests on installed module, not source tree files
  170. - cmd: md __testhome__
  171. - sh: mkdir __testhome__
  172. - cd __testhome__
  173. - cmd: python -m pytest -s -v -m "not (turtle)" --doctest-modules --cov=datalad_gooey --pyargs %DTS%
  174. - sh: python -m pytest -s -v -m "not (turtle)" --doctest-modules --cov=datalad_gooey --pyargs ${DTS}
  175. after_test:
  176. - python -m coverage xml
  177. - cmd: curl -fsSL -o codecov.exe "https://uploader.codecov.io/latest/windows/codecov.exe"
  178. - cmd: .\codecov.exe -f "coverage.xml"
  179. - sh: "curl -Os $CODECOV_BINARY"
  180. - sh: chmod +x codecov
  181. - sh: ./codecov
  182. #on_success:
  183. #
  184. #on_failure:
  185. #
  186. on_finish:
  187. # conditionally block the exit of a CI run for direct debugging
  188. - sh: while [ -f ~/BLOCK ]; do sleep 5; done
  189. - cmd: powershell.exe while ((Test-Path "C:\Users\\appveyor\\Desktop\\BLOCK.txt")) { Start-Sleep 5 }