azure-pipelines.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. trigger:
  2. branches:
  3. include:
  4. - 'devel'
  5. - 'version-*'
  6. pr:
  7. branches:
  8. include:
  9. - '*'
  10. variables:
  11. - name: skipci
  12. value: false
  13. jobs:
  14. - job: packages
  15. timeoutInMinutes: 90 # default `60` led to lots of cancelled jobs; use 0 for unlimited (may be undesirable)
  16. strategy:
  17. matrix:
  18. Linux_amd64:
  19. vmImage: 'ubuntu-20.04'
  20. CPU: amd64
  21. # regularly breaks, refs bug #17325
  22. Linux_i386:
  23. # on 'ubuntu-16.04' (not supported anymore anyways) it errored with:
  24. # g++-multilib : Depends: gcc-multilib (>= 4:5.3.1-1ubuntu1) but it is not going to be installed
  25. vmImage: 'ubuntu-18.04'
  26. CPU: i386
  27. OSX_amd64:
  28. vmImage: 'macOS-11'
  29. CPU: amd64
  30. OSX_amd64_cpp:
  31. vmImage: 'macOS-11'
  32. CPU: amd64
  33. NIM_COMPILE_TO_CPP: true
  34. Windows_amd64_batch0_3:
  35. vmImage: 'windows-2019'
  36. CPU: amd64
  37. # see also: `NIM_TEST_PACKAGES`
  38. NIM_TESTAMENT_BATCH: "0_3"
  39. Windows_amd64_batch1_3:
  40. vmImage: 'windows-2019'
  41. CPU: amd64
  42. NIM_TESTAMENT_BATCH: "1_3"
  43. Windows_amd64_batch2_3:
  44. vmImage: 'windows-2019'
  45. CPU: amd64
  46. NIM_TESTAMENT_BATCH: "2_3"
  47. pool:
  48. vmImage: $(vmImage)
  49. workspace:
  50. clean: all
  51. steps:
  52. - bash: git config --global core.autocrlf false
  53. displayName: 'Disable auto conversion to CRLF by git (Windows-only)'
  54. condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
  55. - checkout: self
  56. fetchDepth: 2 # see D20210329T004830
  57. - bash: |
  58. set -e
  59. . ci/funs.sh
  60. if nimIsCiSkip; then
  61. echo '##vso[task.setvariable variable=skipci]true'
  62. fi
  63. displayName: 'Check whether to skip CI'
  64. - task: NodeTool@0
  65. inputs:
  66. versionSpec: '16.x'
  67. displayName: 'Install node.js 16.x'
  68. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  69. - bash: |
  70. set -e
  71. . ci/funs.sh
  72. echo_run sudo apt-fast update -qq
  73. DEBIAN_FRONTEND='noninteractive' \
  74. echo_run sudo apt-fast install --no-install-recommends -yq \
  75. libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev valgrind libc6-dbg
  76. displayName: 'Install dependencies (amd64 Linux)'
  77. condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'amd64'))
  78. - bash: |
  79. set -e
  80. . ci/funs.sh
  81. echo_run sudo dpkg --add-architecture i386
  82. # Downgrade llvm:
  83. # - llvm has to be downgraded to have 32bit version installed for sfml.
  84. cat << EOF | sudo tee /etc/apt/preferences.d/pin-to-rel
  85. Package: libllvm6.0
  86. Pin: origin "azure.archive.ubuntu.com"
  87. Pin-Priority: 1001
  88. EOF
  89. # echo_run sudo apt-fast update -qq
  90. echo_run sudo apt-fast update -qq || echo "failed, see bug #17343"
  91. # `:i386` (e.g. in `libffi-dev:i386`) is needed otherwise you may get:
  92. # `could not load: libffi.so` during dynamic loading.
  93. DEBIAN_FRONTEND='noninteractive' \
  94. echo_run sudo apt-fast install --no-install-recommends --allow-downgrades -yq \
  95. g++-multilib gcc-multilib libcurl4-openssl-dev:i386 libgc-dev:i386 \
  96. libsdl1.2-dev:i386 libsfml-dev:i386 libglib2.0-dev:i386 libffi-dev:i386
  97. cat << EOF > bin/gcc
  98. #!/bin/bash
  99. exec $(which gcc) -m32 "\$@"
  100. EOF
  101. cat << EOF > bin/g++
  102. #!/bin/bash
  103. exec $(which g++) -m32 "\$@"
  104. EOF
  105. echo_run chmod 755 bin/gcc
  106. echo_run chmod 755 bin/g++
  107. displayName: 'Install dependencies (i386 Linux)'
  108. condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'i386'))
  109. - bash: brew install boehmgc make sfml
  110. displayName: 'Install dependencies (OSX)'
  111. condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Darwin'))
  112. - bash: |
  113. set -e
  114. . ci/funs.sh
  115. nimInternalInstallDepsWindows
  116. echo_run echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/dist/mingw64/bin'
  117. displayName: 'Install dependencies (Windows)'
  118. condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Windows_NT'))
  119. - bash: echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/bin'
  120. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  121. displayName: 'Add build binaries to PATH'
  122. - bash: . ci/funs.sh && nimCiSystemInfo
  123. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  124. displayName: 'System information'
  125. - bash: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc ucpu=$(CPU)
  126. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  127. displayName: 'Build csourcesAny'
  128. # this could be revived if performance justifies it (needs a few updates)
  129. # - task: Cache@2
  130. # inputs:
  131. # key: 'csourcesAny | "$(Agent.OS)" | $(CPU) | $(csources_version)'
  132. # path: $(nim_csources)
  133. # condition: and(succeeded(), eq(variables['skipci'], 'false'))
  134. # displayName: 'Restore built csourcesAny'
  135. - bash: . ci/funs.sh && nimInternalBuildKochAndRunCI
  136. # would could also show on failure: echo '##vso[task.complete result=Failed]'
  137. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  138. displayName: 'koch, Run CI'
  139. env:
  140. SYSTEM_ACCESSTOKEN: $(System.AccessToken)