config.yml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. version: 2
  2. shared:
  3. restore_cache: &restore_cache
  4. restore_cache:
  5. keys:
  6. - ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
  7. - ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
  8. - ccache-{{ arch }}
  9. save_cache: &save_cache
  10. save_cache:
  11. key: ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .BuildNum }}
  12. paths:
  13. - ~/.ccache
  14. restore_homebrew_cache: &restore_homebrew_cache
  15. restore_cache:
  16. keys:
  17. - homebrew-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
  18. - homebrew-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
  19. - homebrew-{{ arch }}
  20. save_homebrew_cache: &save_homebrew_cache
  21. save_cache:
  22. key: homebrew-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .BuildNum }}
  23. paths:
  24. - ~/Library/Caches/Homebrew
  25. - /usr/local/Homebrew
  26. ccache_stats: &ccache_stats
  27. run:
  28. name: Print ccache statistics
  29. command: |
  30. echo "[ccache config]"
  31. ccache -p
  32. echo "[ccache stats]"
  33. ccache -s
  34. # Commmon initializing commands
  35. init: &init
  36. run:
  37. name: Initialize
  38. command: |
  39. mkdir -p /tmp/artifacts
  40. # Workaround for failing submodule fetching
  41. git config --global --unset url."ssh://git@github.com".insteadOf || true
  42. if [[ -n "${CIRCLE_PR_NUMBER}" ]]
  43. then
  44. echo "Fetching out merged pull request"
  45. git fetch -u origin refs/pull/${CIRCLE_PR_NUMBER}/merge:pr/merge
  46. git checkout pr/merge
  47. else
  48. echo "Not a pull request"
  49. fi
  50. # Commmon environment variables
  51. common_environment: &common_environment
  52. QT5: True
  53. CMAKE_OPTS: -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_CCACHE=ON
  54. CCACHE_MAXSIZE: 500M
  55. CCACHE_LOGFILE: /tmp/artifacts/ccache.log
  56. MAKEFLAGS: -j6
  57. jobs:
  58. mingw32:
  59. environment:
  60. <<: *common_environment
  61. docker:
  62. - image: lmmsci/linux.mingw32:18.04
  63. steps:
  64. - checkout
  65. - *init
  66. - *restore_cache
  67. - run:
  68. name: Building
  69. command: |
  70. mkdir build && cd build
  71. ../cmake/build_win32.sh
  72. make lmms
  73. make
  74. - run:
  75. name: Build tests
  76. command: cd build && make tests
  77. - run:
  78. name: Build installer
  79. command: |
  80. cd build
  81. make package
  82. cp ./lmms-*.exe /tmp/artifacts/
  83. - store_artifacts:
  84. path: /tmp/artifacts/
  85. destination: /
  86. - *ccache_stats
  87. - *save_cache
  88. mingw64:
  89. environment:
  90. <<: *common_environment
  91. docker:
  92. - image: lmmsci/linux.mingw64:18.04
  93. steps:
  94. - checkout
  95. - *init
  96. - *restore_cache
  97. - run:
  98. name: Building
  99. command: |
  100. mkdir build && cd build
  101. ../cmake/build_win64.sh
  102. make
  103. - run:
  104. name: Build tests
  105. command: cd build && make tests
  106. - run:
  107. name: Build installer
  108. command: |
  109. cd build
  110. make package
  111. cp ./lmms-*.exe /tmp/artifacts/
  112. - store_artifacts:
  113. path: /tmp/artifacts/
  114. destination: /
  115. - *ccache_stats
  116. - *save_cache
  117. linux.gcc:
  118. docker:
  119. - image: lmmsci/linux.gcc:16.04
  120. environment:
  121. <<: *common_environment
  122. steps:
  123. - checkout
  124. - *init
  125. - *restore_cache
  126. - run:
  127. name: Configure
  128. command: |
  129. source /opt/qt5*/bin/qt5*-env.sh || true
  130. mkdir build && cd build
  131. cmake .. $CMAKE_OPTS -DCMAKE_INSTALL_PREFIX=./install
  132. - run:
  133. name: Build
  134. command: cd build && make
  135. - run:
  136. name: Build tests
  137. command: cd build && make tests
  138. - run:
  139. name: Run tests
  140. command: build/tests/tests
  141. - *ccache_stats
  142. - run:
  143. name: Build AppImage
  144. command: |
  145. cd build
  146. make install
  147. make appimage || (cat appimage.log && false)
  148. cp ./lmms-*.AppImage /tmp/artifacts/
  149. - store_artifacts:
  150. path: /tmp/artifacts/
  151. destination: /
  152. - store_artifacts:
  153. path: build/appimage.log
  154. destination: /
  155. - *save_cache
  156. shellcheck:
  157. docker:
  158. - image: koalaman/shellcheck-alpine:v0.4.6
  159. steps:
  160. - checkout
  161. - run:
  162. name: Shellcheck
  163. command: shellcheck $(find "./cmake/" -type f -name '*.sh' -o -name "*.sh.in")
  164. macos:
  165. environment:
  166. <<: *common_environment
  167. macos:
  168. xcode: "10.3.0"
  169. steps:
  170. - checkout
  171. - *init
  172. - *restore_homebrew_cache
  173. - *restore_cache
  174. - run:
  175. name: Install Homebrew dependencies
  176. command: |
  177. # uninstall Homebrew's python 2 to prevent errors on brew install
  178. brew uninstall python@2 || true
  179. # Working around for https://github.com/Homebrew/brew/pull/9383
  180. (git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch && git merge FETCH_HEAD --ff-only) || true
  181. (git -C "/usr/local/Homebrew" fetch && git merge FETCH_HEAD --ff-only) || true
  182. brew install ccache fftw cmake pkg-config libogg libvorbis lame libsndfile libsamplerate jack sdl libgig libsoundio lilv lv2 stk fluid-synth portaudio fltk qt5 carla
  183. - run:
  184. name: Install nodejs dependencies
  185. command: npm install -g appdmg
  186. - run:
  187. name: Building
  188. command: |
  189. mkdir build && cd build
  190. cmake .. -DCMAKE_INSTALL_PREFIX="../target" -DCMAKE_PREFIX_PATH="$(brew --prefix qt5)" $CMAKE_OPTS -DUSE_WERROR=OFF
  191. make
  192. - run:
  193. name: Build tests
  194. command: cd build && make tests
  195. - run:
  196. name: Run tests
  197. command: build/tests/tests
  198. - run:
  199. name: Build DMG
  200. command: |
  201. cd build
  202. make install
  203. make dmg
  204. cp ./lmms-*.dmg /tmp/artifacts/
  205. - store_artifacts:
  206. path: /tmp/artifacts/
  207. destination: /
  208. - *save_cache
  209. - *save_homebrew_cache
  210. workflows:
  211. version: 2
  212. build-and-test:
  213. jobs:
  214. - macos
  215. - mingw32
  216. - mingw64
  217. - linux.gcc
  218. - shellcheck