config.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. ccache_stats: &ccache_stats
  15. run:
  16. name: Print ccache statistics
  17. command: |
  18. echo "[ccache config]"
  19. ccache -p
  20. echo "[ccache stats]"
  21. ccache -s
  22. # Commmon initializing commands
  23. init: &init
  24. run:
  25. name: Initialize
  26. command: |
  27. mkdir -p /tmp/artifacts
  28. # Commmon environment variables
  29. common_environment: &common_environment
  30. QT5: True
  31. CMAKE_OPTS: -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_CCACHE=ON
  32. CCACHE_MAXSIZE: 500M
  33. CCACHE_LOGFILE: /tmp/artifacts/ccache.log
  34. MAKEFLAGS: -j6
  35. jobs:
  36. mingw32:
  37. environment:
  38. <<: *common_environment
  39. docker:
  40. - image: lmmsci/linux.mingw32:18.04
  41. steps:
  42. - checkout
  43. - *init
  44. - *restore_cache
  45. - run:
  46. name: Building
  47. command: |
  48. mkdir build && cd build
  49. ../cmake/build_win32.sh
  50. make lmms
  51. make
  52. - *ccache_stats
  53. - *save_cache
  54. mingw64:
  55. environment:
  56. <<: *common_environment
  57. docker:
  58. - image: lmmsci/linux.mingw64:18.04
  59. steps:
  60. - checkout
  61. - *init
  62. - *restore_cache
  63. - run:
  64. name: Building
  65. command: |
  66. mkdir build && cd build
  67. ../cmake/build_win64.sh
  68. make
  69. - *ccache_stats
  70. - *save_cache
  71. linux.gcc:
  72. docker:
  73. - image: lmmsci/linux.gcc:18.04
  74. environment:
  75. <<: *common_environment
  76. steps:
  77. - checkout
  78. - *init
  79. - *restore_cache
  80. - run:
  81. name: Configure
  82. command: mkdir build && cd build && cmake .. $CMAKE_OPTS -DCMAKE_INSTALL_PREFIX=./install
  83. - run:
  84. name: Build
  85. command: cd build && make
  86. - run:
  87. name: Build tests
  88. command: cd build && make tests
  89. - run:
  90. name: Run tests
  91. command: build/tests/tests
  92. - *ccache_stats
  93. - run:
  94. name: Build AppImage
  95. command: |
  96. cd build
  97. make install
  98. make appimage || (cat appimage.log && false)
  99. cp ./lmms-*.AppImage /tmp/artifacts/
  100. - store_artifacts:
  101. path: /tmp/artifacts/
  102. destination: /
  103. - store_artifacts:
  104. path: build/appimage.log
  105. destination: /
  106. - *save_cache
  107. shellcheck:
  108. docker:
  109. - image: koalaman/shellcheck-alpine:v0.4.6
  110. steps:
  111. - checkout
  112. - run:
  113. name: Shellcheck
  114. command: shellcheck $(find "./cmake/" -type f -name '*.sh' -o -name "*.sh.in")
  115. workflows:
  116. version: 2
  117. build-and-test:
  118. jobs:
  119. - mingw32
  120. - mingw64
  121. - linux.gcc
  122. - shellcheck