The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

246 lines
6.7 KiB

  1. version: 2
  2. aliases:
  3. - &defaults
  4. docker:
  5. - image: circleci/ruby:2.7-buster-node
  6. environment: &ruby_environment
  7. BUNDLE_APP_CONFIG: ./.bundle/
  8. DB_HOST: localhost
  9. DB_USER: root
  10. RAILS_ENV: test
  11. PARALLEL_TEST_PROCESSORS: 4
  12. ALLOW_NOPAM: true
  13. CONTINUOUS_INTEGRATION: true
  14. DISABLE_SIMPLECOV: true
  15. PAM_ENABLED: true
  16. PAM_DEFAULT_SERVICE: pam_test
  17. PAM_CONTROLLED_SERVICE: pam_test_controlled
  18. working_directory: ~/projects/mastodon/
  19. - &attach_workspace
  20. attach_workspace:
  21. at: ~/projects/
  22. - &persist_to_workspace
  23. persist_to_workspace:
  24. root: ~/projects/
  25. paths:
  26. - ./mastodon/
  27. - &restore_ruby_dependencies
  28. restore_cache:
  29. keys:
  30. - v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
  31. - v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-
  32. - v2-ruby-dependencies-
  33. - &install_steps
  34. steps:
  35. - checkout
  36. - *attach_workspace
  37. - restore_cache:
  38. keys:
  39. - v1-node-dependencies-{{ checksum "yarn.lock" }}
  40. - v1-node-dependencies-
  41. - run: yarn install --frozen-lockfile
  42. - save_cache:
  43. key: v1-node-dependencies-{{ checksum "yarn.lock" }}
  44. paths:
  45. - ./node_modules/
  46. - *persist_to_workspace
  47. - &install_system_dependencies
  48. run:
  49. name: Install system dependencies
  50. command: |
  51. sudo apt-get update
  52. sudo apt-get install -y libicu-dev libidn11-dev libprotobuf-dev protobuf-compiler
  53. ## TODO: FIX THESE BUSTER DEPENDANCES
  54. sudo wget http://ftp.au.debian.org/debian/pool/main/i/icu/libicu57_57.1-6+deb9u3_amd64.deb
  55. sudo dpkg -i libicu57_57.1-6+deb9u3_amd64.deb
  56. sudo wget http://ftp.au.debian.org/debian/pool/main/p/protobuf/libprotobuf10_3.0.0-9_amd64.deb
  57. sudo dpkg -i libprotobuf10_3.0.0-9_amd64.deb
  58. - &install_ruby_dependencies
  59. steps:
  60. - *attach_workspace
  61. - *install_system_dependencies
  62. - run: ruby -e 'puts RUBY_VERSION' | tee /tmp/.ruby-version
  63. - *restore_ruby_dependencies
  64. - run: bundle config set clean 'true'
  65. - run: bundle config set deployment 'true'
  66. - run: bundle config set with 'pam_authentication'
  67. - run: bundle config set without 'development production'
  68. - run: bundle config set frozen 'true'
  69. - run: bundle install --jobs 16 --retry 3 && bundle clean
  70. - save_cache:
  71. key: v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
  72. paths:
  73. - ./.bundle/
  74. - ./vendor/bundle/
  75. - persist_to_workspace:
  76. root: ~/projects/
  77. paths:
  78. - ./mastodon/.bundle/
  79. - ./mastodon/vendor/bundle/
  80. - &test_steps
  81. steps:
  82. - *attach_workspace
  83. - *install_system_dependencies
  84. - run: sudo apt-get install -y ffmpeg
  85. - run:
  86. name: Prepare Tests
  87. command: ./bin/rails parallel:create parallel:load_schema parallel:prepare
  88. - run:
  89. name: Run Tests
  90. command: ./bin/retry bundle exec parallel_test ./spec/ --group-by filesize --type rspec
  91. jobs:
  92. install:
  93. <<: *defaults
  94. <<: *install_steps
  95. install-ruby2.7:
  96. <<: *defaults
  97. <<: *install_ruby_dependencies
  98. install-ruby2.6:
  99. <<: *defaults
  100. docker:
  101. - image: circleci/ruby:2.6-buster-node
  102. environment: *ruby_environment
  103. <<: *install_ruby_dependencies
  104. install-ruby2.5:
  105. <<: *defaults
  106. docker:
  107. - image: circleci/ruby:2.5-buster-node
  108. environment: *ruby_environment
  109. <<: *install_ruby_dependencies
  110. build:
  111. <<: *defaults
  112. steps:
  113. - *attach_workspace
  114. - *install_system_dependencies
  115. - run: ./bin/rails assets:precompile
  116. - persist_to_workspace:
  117. root: ~/projects/
  118. paths:
  119. - ./mastodon/public/assets
  120. - ./mastodon/public/packs-test/
  121. test-migrations:
  122. <<: *defaults
  123. docker:
  124. - image: circleci/ruby:2.7-buster-node
  125. environment: *ruby_environment
  126. - image: circleci/postgres:10.6-alpine
  127. environment:
  128. POSTGRES_USER: root
  129. - image: circleci/redis:5-alpine
  130. steps:
  131. - *attach_workspace
  132. - *install_system_dependencies
  133. - run:
  134. name: Create database
  135. command: ./bin/rails parallel:create
  136. - run:
  137. name: Run migrations
  138. command: ./bin/rails parallel:migrate
  139. test-ruby2.7:
  140. <<: *defaults
  141. docker:
  142. - image: circleci/ruby:2.7-buster-node
  143. environment: *ruby_environment
  144. - image: circleci/postgres:10.6-alpine
  145. environment:
  146. POSTGRES_USER: root
  147. - image: circleci/redis:5-alpine
  148. <<: *test_steps
  149. test-ruby2.6:
  150. <<: *defaults
  151. docker:
  152. - image: circleci/ruby:2.6-buster-node
  153. environment: *ruby_environment
  154. - image: circleci/postgres:10.6-alpine
  155. environment:
  156. POSTGRES_USER: root
  157. - image: circleci/redis:5-alpine
  158. <<: *test_steps
  159. test-ruby2.5:
  160. <<: *defaults
  161. docker:
  162. - image: circleci/ruby:2.5-buster-node
  163. environment: *ruby_environment
  164. - image: circleci/postgres:10.6-alpine
  165. environment:
  166. POSTGRES_USER: root
  167. - image: circleci/redis:5-alpine
  168. <<: *test_steps
  169. test-webui:
  170. <<: *defaults
  171. docker:
  172. - image: circleci/node:12-buster
  173. steps:
  174. - *attach_workspace
  175. - run: ./bin/retry yarn test:jest
  176. check-i18n:
  177. <<: *defaults
  178. steps:
  179. - *attach_workspace
  180. - *install_system_dependencies
  181. - run: bundle exec i18n-tasks check-normalized
  182. - run: bundle exec i18n-tasks unused -l en
  183. - run: bundle exec i18n-tasks check-consistent-interpolations
  184. - run: bundle exec rake repo:check_locales_files
  185. workflows:
  186. version: 2
  187. build-and-test:
  188. jobs:
  189. - install
  190. - install-ruby2.7:
  191. requires:
  192. - install
  193. - install-ruby2.6:
  194. requires:
  195. - install
  196. - install-ruby2.7
  197. - install-ruby2.5:
  198. requires:
  199. - install
  200. - install-ruby2.7
  201. - build:
  202. requires:
  203. - install-ruby2.7
  204. - test-migrations:
  205. requires:
  206. - install-ruby2.7
  207. - test-ruby2.7:
  208. requires:
  209. - install-ruby2.7
  210. - build
  211. - test-ruby2.6:
  212. requires:
  213. - install-ruby2.6
  214. - build
  215. - test-ruby2.5:
  216. requires:
  217. - install-ruby2.5
  218. - build
  219. - test-webui:
  220. requires:
  221. - install
  222. - check-i18n:
  223. requires:
  224. - install-ruby2.7