The code powering m.abunchtell.com https://m.abunchtell.com
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

219 rader
6.0 KiB

  1. version: 2
  2. aliases:
  3. - &defaults
  4. docker:
  5. - image: circleci/ruby:2.6-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 install --clean --jobs 16 --path ./vendor/bundle/ --retry 3 --with pam_authentication --without development production && bundle clean
  65. - save_cache:
  66. key: v2-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
  67. paths:
  68. - ./.bundle/
  69. - ./vendor/bundle/
  70. - persist_to_workspace:
  71. root: ~/projects/
  72. paths:
  73. - ./mastodon/.bundle/
  74. - ./mastodon/vendor/bundle/
  75. - &test_steps
  76. steps:
  77. - *attach_workspace
  78. - *install_system_dependencies
  79. - run: sudo apt-get install -y ffmpeg
  80. - run:
  81. name: Prepare Tests
  82. command: ./bin/rails parallel:create parallel:load_schema parallel:prepare
  83. - run:
  84. name: Run Tests
  85. command: ./bin/retry bundle exec parallel_test ./spec/ --group-by filesize --type rspec
  86. jobs:
  87. install:
  88. <<: *defaults
  89. <<: *install_steps
  90. install-ruby2.6:
  91. <<: *defaults
  92. <<: *install_ruby_dependencies
  93. install-ruby2.5:
  94. <<: *defaults
  95. docker:
  96. - image: circleci/ruby:2.5-buster-node
  97. environment: *ruby_environment
  98. <<: *install_ruby_dependencies
  99. install-ruby2.4:
  100. <<: *defaults
  101. docker:
  102. - image: circleci/ruby:2.4-buster-node
  103. environment: *ruby_environment
  104. <<: *install_ruby_dependencies
  105. build:
  106. <<: *defaults
  107. steps:
  108. - *attach_workspace
  109. - *install_system_dependencies
  110. - run: ./bin/rails assets:precompile
  111. - persist_to_workspace:
  112. root: ~/projects/
  113. paths:
  114. - ./mastodon/public/assets
  115. - ./mastodon/public/packs-test/
  116. test-ruby2.6:
  117. <<: *defaults
  118. docker:
  119. - image: circleci/ruby:2.6-buster-node
  120. environment: *ruby_environment
  121. - image: circleci/postgres:10.6-alpine
  122. environment:
  123. POSTGRES_USER: root
  124. - image: circleci/redis:5-alpine
  125. <<: *test_steps
  126. test-ruby2.5:
  127. <<: *defaults
  128. docker:
  129. - image: circleci/ruby:2.5-buster-node
  130. environment: *ruby_environment
  131. - image: circleci/postgres:10.6-alpine
  132. environment:
  133. POSTGRES_USER: root
  134. - image: circleci/redis:5-alpine
  135. <<: *test_steps
  136. test-ruby2.4:
  137. <<: *defaults
  138. docker:
  139. - image: circleci/ruby:2.4-buster-node
  140. environment: *ruby_environment
  141. - image: circleci/postgres:10.6-alpine
  142. environment:
  143. POSTGRES_USER: root
  144. - image: circleci/redis:5-alpine
  145. <<: *test_steps
  146. test-webui:
  147. <<: *defaults
  148. docker:
  149. - image: circleci/node:12-buster
  150. steps:
  151. - *attach_workspace
  152. - run: ./bin/retry yarn test:jest
  153. check-i18n:
  154. <<: *defaults
  155. steps:
  156. - *attach_workspace
  157. - *install_system_dependencies
  158. - run: bundle exec i18n-tasks check-normalized
  159. - run: bundle exec i18n-tasks unused -l en
  160. - run: bundle exec i18n-tasks check-consistent-interpolations
  161. - run: bundle exec rake repo:check_locales_files
  162. workflows:
  163. version: 2
  164. build-and-test:
  165. jobs:
  166. - install
  167. - install-ruby2.6:
  168. requires:
  169. - install
  170. - install-ruby2.5:
  171. requires:
  172. - install
  173. - install-ruby2.6
  174. - install-ruby2.4:
  175. requires:
  176. - install
  177. - install-ruby2.6
  178. - build:
  179. requires:
  180. - install-ruby2.6
  181. - test-ruby2.6:
  182. requires:
  183. - install-ruby2.6
  184. - build
  185. - test-ruby2.5:
  186. requires:
  187. - install-ruby2.5
  188. - build
  189. - test-ruby2.4:
  190. requires:
  191. - install-ruby2.4
  192. - build
  193. - test-webui:
  194. requires:
  195. - install
  196. - check-i18n:
  197. requires:
  198. - install-ruby2.6