azure-pipelines.yml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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-16.04'
  19. CPU: amd64
  20. Linux_i386:
  21. # bug #17325: fails on 'ubuntu-16.04' because it now errors with:
  22. # g++-multilib : Depends: gcc-multilib (>= 4:5.3.1-1ubuntu1) but it is not going to be installed
  23. vmImage: 'ubuntu-18.04'
  24. CPU: i386
  25. OSX_amd64:
  26. vmImage: 'macOS-10.15'
  27. CPU: amd64
  28. OSX_amd64_cpp:
  29. vmImage: 'macOS-10.15'
  30. CPU: amd64
  31. NIM_COMPILE_TO_CPP: true
  32. Windows_amd64_batch0_3:
  33. vmImage: 'windows-2019'
  34. CPU: amd64
  35. # see also: `NIM_TEST_PACKAGES`
  36. NIM_TESTAMENT_BATCH: "0_3"
  37. Windows_amd64_batch1_3:
  38. vmImage: 'windows-2019'
  39. CPU: amd64
  40. NIM_TESTAMENT_BATCH: "1_3"
  41. Windows_amd64_batch2_3:
  42. vmImage: 'windows-2019'
  43. CPU: amd64
  44. NIM_TESTAMENT_BATCH: "2_3"
  45. pool:
  46. vmImage: $(vmImage)
  47. workspace:
  48. clean: all
  49. steps:
  50. - bash: git config --global core.autocrlf false
  51. displayName: 'Disable auto conversion to CRLF by git (Windows-only)'
  52. condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
  53. - checkout: self
  54. fetchDepth: 2 # see D20210329T004830
  55. - bash: |
  56. set -e
  57. . ci/funs.sh
  58. if nimIsCiSkip; then
  59. echo '##vso[task.setvariable variable=skipci]true'
  60. fi
  61. displayName: 'Check whether to skip CI'
  62. - task: NodeTool@0
  63. inputs:
  64. versionSpec: '12.x'
  65. displayName: 'Install node.js 12.x'
  66. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  67. - bash: |
  68. set -e
  69. . ci/funs.sh
  70. echo_run sudo apt-fast update -qq
  71. DEBIAN_FRONTEND='noninteractive' \
  72. echo_run sudo apt-fast install --no-install-recommends -yq \
  73. libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev valgrind libc6-dbg
  74. displayName: 'Install dependencies (amd64 Linux)'
  75. condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'amd64'))
  76. - bash: |
  77. set -e
  78. . ci/funs.sh
  79. echo_run sudo dpkg --add-architecture i386
  80. # Downgrade llvm:
  81. # - llvm has to be downgraded to have 32bit version installed for sfml.
  82. cat << EOF | sudo tee /etc/apt/preferences.d/pin-to-rel
  83. Package: libllvm6.0
  84. Pin: origin "azure.archive.ubuntu.com"
  85. Pin-Priority: 1001
  86. EOF
  87. # echo_run sudo apt-fast update -qq
  88. echo_run sudo apt-fast update -qq || echo "failed, see bug #17343"
  89. # `:i386` (e.g. in `libffi-dev:i386`) is needed otherwise you may get:
  90. # `could not load: libffi.so` during dynamic loading.
  91. DEBIAN_FRONTEND='noninteractive' \
  92. echo_run sudo apt-fast install --no-install-recommends --allow-downgrades -yq \
  93. g++-multilib gcc-multilib libcurl4-openssl-dev:i386 libgc-dev:i386 \
  94. libsdl1.2-dev:i386 libsfml-dev:i386 libglib2.0-dev:i386 libffi-dev:i386
  95. cat << EOF > bin/gcc
  96. #!/bin/bash
  97. exec $(which gcc) -m32 "\$@"
  98. EOF
  99. cat << EOF > bin/g++
  100. #!/bin/bash
  101. exec $(which g++) -m32 "\$@"
  102. EOF
  103. echo_run chmod 755 bin/gcc
  104. echo_run chmod 755 bin/g++
  105. displayName: 'Install dependencies (i386 Linux)'
  106. condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'i386'))
  107. - bash: brew install boehmgc make sfml
  108. displayName: 'Install dependencies (OSX)'
  109. condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Darwin'))
  110. - bash: |
  111. set -e
  112. . ci/funs.sh
  113. echo_run mkdir dist
  114. echo_run curl -L https://nim-lang.org/download/mingw64.7z -o dist/mingw64.7z
  115. echo_run curl -L https://nim-lang.org/download/dlls.zip -o dist/dlls.zip
  116. echo_run 7z x dist/mingw64.7z -odist
  117. echo_run 7z x dist/dlls.zip -obin
  118. echo_run echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/dist/mingw64/bin'
  119. displayName: 'Install dependencies (Windows)'
  120. condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Windows_NT'))
  121. - bash: echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/bin'
  122. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  123. displayName: 'Add build binaries to PATH'
  124. - bash: |
  125. set -e
  126. . ci/funs.sh
  127. echo_run echo 'PATH:' "$PATH"
  128. echo_run echo '##[section]gcc version'
  129. echo_run gcc -v
  130. echo_run echo '##[section]nodejs version'
  131. echo_run node -v
  132. echo_run echo '##[section]make version'
  133. echo_run make -v
  134. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  135. displayName: 'System information'
  136. - bash: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc ucpu=$(CPU)
  137. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  138. displayName: 'Build csourcesAny'
  139. # this could be revived if performance justifies it (needs a few updates)
  140. # - task: Cache@2
  141. # inputs:
  142. # key: 'csourcesAny | "$(Agent.OS)" | $(CPU) | $(csources_version)'
  143. # path: $(nim_csources)
  144. # condition: and(succeeded(), eq(variables['skipci'], 'false'))
  145. # displayName: 'Restore built csourcesAny'
  146. - bash: nim c koch
  147. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  148. displayName: 'Build koch'
  149. # set result to omit the "bash exited with error code '1'" message
  150. - bash: ./koch runCI || echo '##vso[task.complete result=Failed]'
  151. condition: and(succeeded(), eq(variables['skipci'], 'false'))
  152. displayName: 'Run CI'
  153. env:
  154. SYSTEM_ACCESSTOKEN: $(System.AccessToken)