config.yml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. # Python CircleCI 2.0 configuration file
  2. #
  3. # Check https://circleci.com/docs/2.0/language-python/ for more details
  4. #
  5. version: 2
  6. jobs:
  7. build:
  8. docker:
  9. # specify the version you desire here
  10. # - image: circleci/python:3.8.0
  11. - image: gethue/hue:latest
  12. # Specify service dependencies here if necessary
  13. # CircleCI maintains a library of pre-built images
  14. # documented at https://circleci.com/docs/2.0/circleci-images/
  15. # - image: circleci/postgres:9.4
  16. working_directory: ~/repo
  17. steps:
  18. - checkout
  19. # Download and cache dependencies
  20. # - restore_cache:
  21. # keys:
  22. # - v1-dependencies-{{ checksum "requirements.txt" }}
  23. # # fallback to using the latest cache if no exact match is found
  24. # - v1-dependencies-
  25. # - run:
  26. # name: install dependencies
  27. # command: |
  28. # python -m venv venv
  29. # . venv/bin/activate
  30. # pip install -r requirements.txt
  31. # - save_cache:
  32. # paths:
  33. # - ./venv
  34. # key: v1-dependencies-{{ checksum "requirements.txt" }}
  35. # Revert to traditional pip install when build refactored, in the meantime:
  36. - run:
  37. name: refresh sources
  38. command: |
  39. rm -r /usr/share/hue/desktop/core/src/desktop
  40. cp -r desktop/core/src/desktop /usr/share/hue/desktop/core/src/desktop
  41. for lib in `ls desktop/libs`
  42. do
  43. rm -r /usr/share/hue/desktop/libs/$lib/src/$lib
  44. cp -r desktop/libs/$lib/src/$lib /usr/share/hue/desktop/libs/$lib/src/$lib
  45. done
  46. for lib in `ls apps | grep -v Makefile`
  47. do
  48. rm -r /usr/share/hue/apps/$lib/src/$lib
  49. cp -r apps/$lib/src/$lib /usr/share/hue/apps/$lib/src/$lib
  50. done
  51. rm -r /usr/share/hue/tools
  52. cp -r tools /usr/share/hue
  53. rm /usr/share/hue/desktop/conf/*.ini
  54. cp desktop/conf/pseudo-distributed.ini.tmpl /usr/share/hue/desktop/conf/pseudo-distributed.ini
  55. # ini configuration tweaks
  56. sed -i 's/## has_iam_detection=true/ has_iam_detection=false/g' /usr/share/hue/desktop/conf/pseudo-distributed.ini
  57. cd /usr/share/hue
  58. # make npm-install # Not available
  59. cp ~/repo/.babelrc .
  60. cp ~/repo/jest.config.js .
  61. cp ~/repo/webpack.config*.js .
  62. npm install
  63. npm i eslint-plugin-jest@latest --save-dev # Seems to not be found otherwise
  64. npm run webpack
  65. npm run webpack-login
  66. npm run webpack-workers
  67. ./build/env/bin/hue collectstatic --noinput
  68. # cp -r ~/repo/docs .
  69. # make doc
  70. # hugo --source docs/docs-site
  71. # Run code analyses
  72. - run:
  73. name: run python lints
  74. command: |
  75. cd ~/repo
  76. ./tools/ci/check_for_invalid_characters.sh
  77. - run:
  78. name: run js lint
  79. command: |
  80. cd /usr/share/hue
  81. cp ~/repo/.prettierrc .
  82. cp ~/repo/.eslint* .
  83. cp ~/repo/tools . -r
  84. npm run lint
  85. # Run tests
  86. - run:
  87. name: run python API tests
  88. command: |
  89. cd /usr/share/hue
  90. ./build/env/bin/hue test unit --with-xunit --with-cover
  91. - run:
  92. name: run js tests
  93. command: |
  94. cd /usr/share/hue
  95. # https://jestjs.io/docs/en/troubleshooting.html#tests-are-extremely-slow-on-docker-andor-continuous-integration-ci-server
  96. sed -i 's/"test": "jest"/"test": "jest --runInBand"/g' package.json
  97. npm run test
  98. - store_artifacts:
  99. path: test-reports
  100. destination: test-reports
  101. commit:
  102. docker:
  103. - image: circleci/python:3.8.0
  104. working_directory: ~/repo
  105. steps:
  106. - checkout
  107. - add_ssh_keys:
  108. fingerprints:
  109. - "8c:68:29:28:04:80:38:31:c0:59:d9:3d:65:3e:b7:8c"
  110. - run:
  111. name: push to master
  112. command: |
  113. git push origin HEAD:master
  114. build-py3.6:
  115. docker:
  116. - image: gethue/hue:latest # Should be circleci/python:3.6 at some point
  117. working_directory: ~/repo
  118. steps:
  119. - checkout
  120. # Download and cache dependencies
  121. # - restore_cache:
  122. # keys:
  123. # - v1-dependencies-{{ checksum "desktop/core/requirements_py3.txt" }}
  124. # # fallback to using the latest cache if no exact match is found
  125. # - v1-dependencies-
  126. - run:
  127. name: compile
  128. command: |
  129. apt-get install -y python3.6-dev libsnappy-dev # This should not be needed as some point
  130. export PYTHON_VER=python3.6
  131. make apps
  132. - run:
  133. name: run tests
  134. command: |
  135. ./build/env/bin/hue test unit --with-xunit --with-cover
  136. # - run:
  137. # name: install dependencies
  138. # command: |
  139. # python -m venv venv
  140. # make apps
  141. # - save_cache:
  142. # paths:
  143. # - ./build/venv
  144. # key: v1-dependencies-{{ checksum "esktop/core/requirements_py3.txt" }}
  145. build-py3.8:
  146. docker:
  147. - image: gethue/hue:latest # Should be circleci/python:3.x at some point
  148. working_directory: ~/repo
  149. steps:
  150. - checkout
  151. - run:
  152. name: compile
  153. command: |
  154. apt-get install -y python3.8-dev python3.8-venv python3.8-distutils libsnappy-dev # This should not be needed as some point
  155. export PYTHON_VER=python3.8
  156. make apps
  157. - run:
  158. name: run tests
  159. command: |
  160. ./build/env/bin/hue test unit --with-xunit --with-cover
  161. workflows:
  162. version: 2
  163. run-tests-and-rebase-master:
  164. jobs:
  165. - build:
  166. filters:
  167. branches:
  168. ignore:
  169. - master
  170. - py3-ci
  171. - build-py3.6:
  172. filters:
  173. branches:
  174. ignore:
  175. - master
  176. - py3-ci
  177. - commit:
  178. requires:
  179. - build
  180. - build-py3.6
  181. filters:
  182. branches:
  183. only:
  184. - /.*ci-commit-master.*/
  185. build-python3:
  186. jobs:
  187. - build-py3.8:
  188. filters:
  189. branches:
  190. only:
  191. - py3-ci
  192. - build-py3.6:
  193. filters:
  194. branches:
  195. only:
  196. - py3-ci