@@ -5,12 +5,13 @@ aliases:
55 docker :
66 - image : circleci/ruby:2.7-buster-node
77 environment : &ruby_environment
8+ BUNDLE_JOBS : 3
9+ BUNDLE_RETRY : 3
810 BUNDLE_APP_CONFIG : ./.bundle/
911 BUNDLE_PATH : ./vendor/bundle/
1012 DB_HOST : localhost
1113 DB_USER : root
1214 RAILS_ENV : test
13- PARALLEL_TEST_PROCESSORS : 4
1415 ALLOW_NOPAM : true
1516 CONTINUOUS_INTEGRATION : true
1617 DISABLE_SIMPLECOV : true
@@ -32,21 +33,23 @@ aliases:
3233 - &restore_ruby_dependencies
3334 restore_cache :
3435 keys :
35- - v2 -ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
36- - v2 -ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-
37- - v2 -ruby-dependencies-
36+ - v3 -ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
37+ - v3 -ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-
38+ - v3 -ruby-dependencies-
3839
3940 - &install_steps
4041 steps :
4142 - checkout
4243 - *attach_workspace
4344 - restore_cache :
4445 keys :
45- - v1.01-node-dependencies-{{ checksum "yarn.lock" }}
46- - v1.01-node-dependencies-
47- - run : yarn install --frozen-lockfile
46+ - v2-node-dependencies-{{ checksum "yarn.lock" }}
47+ - v2-node-dependencies-
48+ - run :
49+ name : Install yarn dependencies
50+ command : yarn install --frozen-lockfile
4851 - save_cache :
49- key : v1.01 -node-dependencies-{{ checksum "yarn.lock" }}
52+ key : v2 -node-dependencies-{{ checksum "yarn.lock" }}
5053 paths :
5154 - ./node_modules/
5255 - *persist_to_workspace
@@ -57,27 +60,28 @@ aliases:
5760 command : |
5861 sudo apt-get update
5962 sudo apt-get install -y libicu-dev libidn11-dev libprotobuf-dev protobuf-compiler
60-
61- ## TODO: FIX THESE BUSTER DEPENDANCES
62- sudo wget http://ftp.au.debian.org/debian/pool/main/i/icu/libicu57_57.1-6+deb9u3_amd64.deb
63- sudo dpkg -i libicu57_57.1-6+deb9u3_amd64.deb
64- sudo wget http://ftp.au.debian.org/debian/pool/main/p/protobuf/libprotobuf10_3.0.0-9_amd64.deb
65- sudo dpkg -i libprotobuf10_3.0.0-9_amd64.deb
6663
6764 - &install_ruby_dependencies
6865 steps :
6966 - *attach_workspace
7067 - *install_system_dependencies
71- - run : ruby -e 'puts RUBY_VERSION' | tee /tmp/.ruby-version
68+ - run :
69+ name : Set Ruby version
70+ command : ruby -e 'puts RUBY_VERSION' | tee /tmp/.ruby-version
7271 - *restore_ruby_dependencies
73- - run : bundle config set clean 'true'
74- - run : bundle config set deployment 'true'
75- - run : bundle config set with 'pam_authentication'
76- - run : bundle config set without 'development production'
77- - run : bundle config set frozen 'true'
78- - run : bundle install --jobs 16 --retry 3 && bundle clean
72+ - run :
73+ name : Set bundler settings
74+ command : |
75+ bundle config clean 'true'
76+ bundle config deployment 'true'
77+ bundle config with 'pam_authentication'
78+ bundle config without 'development production'
79+ bundle config frozen 'true'
80+ - run :
81+ name : Install bundler dependencies
82+ command : bundle check || (bundle install && bundle clean)
7983 - save_cache :
80- key : v2 -ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
84+ key : v3 -ruby-dependencies-{{ checksum "/tmp/.ruby-version" }}-{{ checksum "Gemfile.lock" }}
8185 paths :
8286 - ./.bundle/
8387 - ./vendor/bundle/
@@ -88,17 +92,26 @@ aliases:
8892 - ./mastodon/vendor/bundle/
8993
9094 - &test_steps
95+ parallelism : 4
9196 steps :
9297 - *attach_workspace
9398 - *install_system_dependencies
94- - run : sudo apt-get install -y ffmpeg
9599 - run :
96- name : Prepare Tests
97- command : ./bin/rails parallel:create parallel:load_schema parallel:prepare
100+ name : Install FFMPEG
101+ command : sudo apt-get install -y ffmpeg
98102 - run :
99- name : Run Tests
100- command : ./bin/retry bundle exec parallel_test ./spec/ --group-by filesize --type rspec
101-
103+ name : Load database schema
104+ command : ./bin/rails db:create db:schema:load db:seed
105+ - run :
106+ name : Run rspec in parallel
107+ command : |
108+ bundle exec rspec --profile 10 \
109+ --format RspecJunitFormatter \
110+ --out test_results/rspec.xml \
111+ --format progress \
112+ $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
113+ - store_test_results :
114+ path : test_results
102115jobs :
103116 install :
104117 << : *defaults
@@ -115,19 +128,14 @@ jobs:
115128 environment : *ruby_environment
116129 << : *install_ruby_dependencies
117130
118- install-ruby2.5 :
119- << : *defaults
120- docker :
121- - image : circleci/ruby:2.5-buster-node
122- environment : *ruby_environment
123- << : *install_ruby_dependencies
124-
125131 build :
126132 << : *defaults
127133 steps :
128134 - *attach_workspace
129135 - *install_system_dependencies
130- - run : ./bin/rails assets:precompile
136+ - run :
137+ name : Precompile assets
138+ command : ./bin/rails assets:precompile
131139 - persist_to_workspace :
132140 root : ~/projects/
133141 paths :
@@ -139,28 +147,30 @@ jobs:
139147 docker :
140148 - image : circleci/ruby:2.7-buster-node
141149 environment : *ruby_environment
142- - image : circleci/postgres:10.6-alpine
150+ - image : circleci/postgres:12.2
143151 environment :
144152 POSTGRES_USER : root
153+ POSTGRES_HOST_AUTH_METHOD : trust
145154 - image : circleci/redis:5-alpine
146155 steps :
147156 - *attach_workspace
148157 - *install_system_dependencies
149158 - run :
150159 name : Create database
151- command : ./bin/rails parallel :create
160+ command : ./bin/rails db :create
152161 - run :
153162 name : Run migrations
154- command : ./bin/rails parallel :migrate
163+ command : ./bin/rails db :migrate
155164
156165 test-ruby2.7 :
157166 << : *defaults
158167 docker :
159168 - image : circleci/ruby:2.7-buster-node
160169 environment : *ruby_environment
161- - image : circleci/postgres:10.6-alpine
170+ - image : circleci/postgres:12.2
162171 environment :
163172 POSTGRES_USER : root
173+ POSTGRES_HOST_AUTH_METHOD : trust
164174 - image : circleci/redis:5-alpine
165175 << : *test_steps
166176
@@ -169,20 +179,10 @@ jobs:
169179 docker :
170180 - image : circleci/ruby:2.6-buster-node
171181 environment : *ruby_environment
172- - image : circleci/postgres:10.6-alpine
173- environment :
174- POSTGRES_USER : root
175- - image : circleci/redis:5-alpine
176- << : *test_steps
177-
178- test-ruby2.5 :
179- << : *defaults
180- docker :
181- - image : circleci/ruby:2.5-buster-node
182- environment : *ruby_environment
183- - image : circleci/postgres:10.6-alpine
182+ - image : circleci/postgres:12.2
184183 environment :
185184 POSTGRES_USER : root
185+ POSTGRES_HOST_AUTH_METHOD : trust
186186 - image : circleci/redis:5-alpine
187187 << : *test_steps
188188
@@ -192,17 +192,27 @@ jobs:
192192 - image : circleci/node:12-buster
193193 steps :
194194 - *attach_workspace
195- - run : ./bin/retry yarn test:jest
195+ - run :
196+ name : Run jest
197+ command : yarn test:jest
196198
197199 check-i18n :
198200 << : *defaults
199201 steps :
200202 - *attach_workspace
201203 - *install_system_dependencies
202- - run : bundle exec i18n-tasks check-normalized
203- # - run: bundle exec i18n-tasks unused -l en
204- - run : bundle exec i18n-tasks check-consistent-interpolations
205- - run : bundle exec rake repo:check_locales_files
204+ - run :
205+ name : Check locale file normalization
206+ command : bundle exec i18n-tasks check-normalized
207+ # - run:
208+ # name: Check for unused strings
209+ # command: bundle exec i18n-tasks unused -l en
210+ - run :
211+ name : Check for wrong string interpolations
212+ command : bundle exec i18n-tasks check-consistent-interpolations
213+ - run :
214+ name : Check that all required locale files exist
215+ command : bundle exec rake repo:check_locales_files
206216
207217workflows :
208218 version : 2
@@ -216,10 +226,6 @@ workflows:
216226 requires :
217227 - install
218228 - install-ruby2.7
219- - install-ruby2.5 :
220- requires :
221- - install
222- - install-ruby2.7
223229 - build :
224230 requires :
225231 - install-ruby2.7
@@ -234,10 +240,6 @@ workflows:
234240 requires :
235241 - install-ruby2.6
236242 - build
237- - test-ruby2.5 :
238- requires :
239- - install-ruby2.5
240- - build
241243 - test-webui :
242244 requires :
243245 - install
0 commit comments