azure-pipelines.yml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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-24.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-13'
  29. CPU: amd64
  30. OSX_amd64_cpp:
  31. vmImage: 'macOS-13'
  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: '20.x'
  67. displayName: 'Install node.js 20.x'
  68. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  69. - bash: |
  70. set -e
  71. . ci/funs.sh
  72. echo_run sudo add-apt-repository universe
  73. echo_run sudo apt-get update -qq
  74. DEBIAN_FRONTEND='noninteractive' \
  75. echo_run sudo apt-get install --no-install-recommends -yq \
  76. gcc-14 g++-14 libpcre3 liblapack-dev libpcre3 liblapack-dev libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev valgrind libc6-dbg
  77. echo_run sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 60 --slave /usr/bin/g++ g++ /usr/bin/g++-14
  78. displayName: 'Install dependencies (amd64 Linux)'
  79. condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'amd64'))
  80. - bash: |
  81. set -e
  82. . ci/funs.sh
  83. echo_run sudo dpkg --add-architecture i386
  84. # Downgrade llvm:
  85. # - llvm has to be downgraded to have 32bit version installed for sfml.
  86. cat << EOF | sudo tee /etc/apt/preferences.d/pin-to-rel
  87. Package: libllvm6.0
  88. Pin: origin "azure.archive.ubuntu.com"
  89. Pin-Priority: 1001
  90. EOF
  91. # echo_run sudo apt-get update -qq
  92. echo_run sudo apt-get update -qq || echo "failed, see bug #17343"
  93. # `:i386` (e.g. in `libffi-dev:i386`) is needed otherwise you may get:
  94. # `could not load: libffi.so` during dynamic loading.
  95. DEBIAN_FRONTEND='noninteractive' \
  96. echo_run sudo apt-get install --no-install-recommends --allow-downgrades -yq \
  97. g++-multilib gcc-multilib libcurl4-openssl-dev:i386 libgc-dev:i386 \
  98. libsdl1.2-dev:i386 libsfml-dev:i386 libglib2.0-dev:i386 libffi-dev:i386
  99. cat << EOF > bin/gcc
  100. #!/bin/bash
  101. exec $(which gcc) -m32 "\$@"
  102. EOF
  103. cat << EOF > bin/g++
  104. #!/bin/bash
  105. exec $(which g++) -m32 "\$@"
  106. EOF
  107. echo_run chmod 755 bin/gcc
  108. echo_run chmod 755 bin/g++
  109. displayName: 'Install dependencies (i386 Linux)'
  110. condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'i386'))
  111. - bash: brew install boehmgc make sfml
  112. displayName: 'Install dependencies (OSX)'
  113. condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Darwin'))
  114. # XXX can't find boehm on macos 13
  115. - bash: |
  116. set -e
  117. . ci/funs.sh
  118. nimInternalInstallDepsWindows
  119. echo_run echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/dist/mingw64/bin'
  120. displayName: 'Install dependencies (Windows)'
  121. condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Windows_NT'))
  122. - bash: echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/bin'
  123. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  124. displayName: 'Add build binaries to PATH'
  125. - bash: . ci/funs.sh && nimCiSystemInfo
  126. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  127. displayName: 'System information'
  128. - bash: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc ucpu=$(CPU)
  129. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  130. displayName: 'Build csourcesAny'
  131. # this could be revived if performance justifies it (needs a few updates)
  132. # - task: Cache@2
  133. # inputs:
  134. # key: 'csourcesAny | "$(Agent.OS)" | $(CPU) | $(csources_version)'
  135. # path: $(nim_csources)
  136. # condition: and(succeeded(), eq(variables['skipci'], 'false'))
  137. # displayName: 'Restore built csourcesAny'
  138. - bash: . ci/funs.sh && nimInternalBuildKochAndRunCI
  139. # would could also show on failure: echo '##vso[task.complete result=Failed]'
  140. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  141. displayName: 'koch, Run CI'
  142. env:
  143. SYSTEM_ACCESSTOKEN: $(System.AccessToken)