azure-pipelines.yml 5.4 KB

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