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.
 
 
 
 

167 lines
4.2 KiB

  1. version: 2
  2. aliases:
  3. - &defaults
  4. docker:
  5. - image: circleci/ruby:2.5.1-stretch-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. working_directory: ~/projects/mastodon/
  14. - &attach_workspace
  15. attach_workspace:
  16. at: ~/projects/
  17. - &persist_to_workspace
  18. persist_to_workspace:
  19. root: ~/projects/
  20. paths:
  21. - ./mastodon/
  22. - &install_steps
  23. steps:
  24. - checkout
  25. - *attach_workspace
  26. - restore_cache:
  27. keys:
  28. - v1-node-dependencies-{{ checksum "yarn.lock" }}
  29. - v1-node-dependencies-
  30. - run: yarn install --frozen-lockfile
  31. - save_cache:
  32. key: v1-node-dependencies-{{ checksum "yarn.lock" }}
  33. paths:
  34. - ./node_modules/
  35. - *persist_to_workspace
  36. - &install_system_dependencies
  37. run:
  38. name: Install system dependencies
  39. command: |
  40. sudo apt-get update
  41. sudo apt-get install -y libicu-dev libidn11-dev libprotobuf-dev protobuf-compiler
  42. - &install_ruby_dependencies
  43. steps:
  44. - *attach_workspace
  45. - *install_system_dependencies
  46. - run: ruby -e 'puts RUBY_VERSION' | tee /tmp/.ruby-version
  47. - restore_cache:
  48. keys:
  49. - v1-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
  50. - v1-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-
  51. - v1-ruby-dependencies--
  52. - run: bundle install --clean --jobs 16 --path ./vendor/bundle/ --retry 3 --with pam_authentication --without development production
  53. - save_cache:
  54. key: v1-ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
  55. paths:
  56. - ./vendor/bundle/
  57. - run:
  58. name: Precompile Assets
  59. command: |
  60. if [ ! -d ./public/assets/ -o ! -d ./public/packs-test/ ]; then
  61. ./bin/rails assets:precompile
  62. fi
  63. - *persist_to_workspace
  64. - &test_steps
  65. steps:
  66. - *attach_workspace
  67. - *install_system_dependencies
  68. - run: sudo apt-get install -y ffmpeg
  69. - run:
  70. name: Prepare Tests
  71. command: ./bin/rails parallel:create parallel:load_schema parallel:prepare
  72. - run:
  73. name: Run Tests
  74. command: bundle exec parallel_test ./spec/ --group-by filesize --type rspec
  75. jobs:
  76. install:
  77. <<: *defaults
  78. <<: *install_steps
  79. install-ruby2.5:
  80. <<: *defaults
  81. <<: *install_ruby_dependencies
  82. install-ruby2.4:
  83. <<: *defaults
  84. docker:
  85. - image: circleci/ruby:2.4.4-stretch-node
  86. environment: *ruby_environment
  87. <<: *install_ruby_dependencies
  88. test-ruby2.5:
  89. <<: *defaults
  90. docker:
  91. - image: circleci/ruby:2.5.1-stretch-node
  92. environment: *ruby_environment
  93. - image: circleci/postgres:10.3-alpine
  94. environment:
  95. POSTGRES_USER: root
  96. - image: circleci/redis:4.0.9-alpine
  97. <<: *test_steps
  98. test-ruby2.4:
  99. <<: *defaults
  100. docker:
  101. - image: circleci/ruby:2.4.4-stretch-node
  102. environment: *ruby_environment
  103. - image: circleci/postgres:10.3-alpine
  104. environment:
  105. POSTGRES_USER: root
  106. - image: circleci/redis:4.0.9-alpine
  107. <<: *test_steps
  108. test-webui:
  109. <<: *defaults
  110. docker:
  111. - image: circleci/node:8.11.1-stretch
  112. steps:
  113. - *attach_workspace
  114. - run: yarn test:jest
  115. check-i18n:
  116. <<: *defaults
  117. steps:
  118. - *attach_workspace
  119. - run: bundle exec i18n-tasks check-normalized
  120. - run: bundle exec i18n-tasks unused
  121. workflows:
  122. version: 2
  123. build-and-test:
  124. jobs:
  125. - install
  126. - install-ruby2.5:
  127. requires:
  128. - install
  129. - install-ruby2.4:
  130. requires:
  131. - install-ruby2.5
  132. - test-ruby2.5:
  133. requires:
  134. - install-ruby2.5
  135. - test-ruby2.4:
  136. requires:
  137. - install-ruby2.4
  138. - test-webui:
  139. requires:
  140. - install
  141. - check-i18n:
  142. requires:
  143. - install-ruby2.5