11version : 2.1
22jobs :
3- test :
3+ test-ruby27 :
44 docker :
55 - image : cimg/ruby:2.7-node
66 - image : cimg/mysql:8.0
77 command : [--default-authentication-plugin=mysql_native_password]
88 environment :
99 MYSQL_ROOT_HOST : ' %'
10- MYSQL_USER : ' root'
1110 MYSQL_ROOT_PASSWORD : ' root'
1211 MYSQL_DATABASE : ' qpixel_test'
1312 - image : cimg/redis:7.0
@@ -23,21 +22,157 @@ jobs:
2322 - checkout
2423 - restore_cache :
2524 keys :
26- - qpixel-{{ checksum "Gemfile" }}
27- - qpixel-
25+ - qpixel-ruby27- {{ checksum "Gemfile.lock " }}
26+ - qpixel-ruby27-
2827 - run :
2928 name : Install Bundler & gems
3029 command : |
3130 gem install bundler
3231 bundle install --path=~/gems
32+ - run :
33+ name : Clean unnecessary gems
34+ command : |
35+ bundle clean --force
36+ - save_cache :
37+ key : qpixel-ruby27-{{ checksum "Gemfile.lock" }}
38+ paths :
39+ - ~/gems
40+ - run :
41+ name : Copy key
42+ command : |
43+ if [ -z "$MASTER_KEY" ]; then rm config/credentials.yml.enc; else echo "$MASTER_KEY" > config/master.key; fi
44+ - run :
45+ name : Prepare config & database
46+ environment :
47+ RAILS_ENV : test
48+ command : |
49+ cp config/database.sample.yml config/database.yml
50+ cp config/storage.sample.yml config/storage.yml
51+ bundle exec rails db:create
52+ bundle exec rails db:schema:load
53+ bundle exec rails db:migrate
54+ bundle exec rails test:prepare
55+ - run :
56+ name : Current revision
57+ command : |
58+ git rev-parse $(git rev-parse --abbrev-ref HEAD)
59+ - run :
60+ name : Coveralls token
61+ command : |
62+ if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo "Skipping coveralls"; else echo "repo_token: $COVERALLS_REPO_TOKEN" > .coveralls.yml; fi
63+ - run :
64+ name : Test
65+ command : |
66+ bundle exec rails test
67+ - store_test_results :
68+ path : " ~/qpixel/test/reports"
69+ system-test-ruby27 :
70+ docker :
71+ - image : cimg/ruby:2.7-browsers
72+ - image : cimg/mysql:8.0
73+ command : [--default-authentication-plugin=mysql_native_password]
74+ environment :
75+ MYSQL_ROOT_HOST : ' %'
76+ MYSQL_ROOT_PASSWORD : ' root'
77+ MYSQL_DATABASE : ' qpixel_test'
78+ - image : cimg/redis:7.0
79+
80+ working_directory : ~/qpixel
81+
82+ steps :
83+ - run :
84+ name : Install packages
85+ command : |
86+ sudo apt-get --allow-releaseinfo-change -qq update
87+ sudo apt-get -y install git libmariadb-dev libmagickwand-dev
88+ - checkout
89+ - restore_cache :
90+ keys :
91+ - qpixel-ruby27-{{ checksum "Gemfile.lock" }}
92+ - qpixel-ruby27-
93+ - run :
94+ name : Install Bundler & gems
95+ command : |
96+ gem install bundler
97+ bundle install --path=~/gems
98+ - run :
99+ name : Clean unnecessary gems
100+ command : |
101+ bundle clean --force
102+ - save_cache :
103+ key : qpixel-ruby27-{{ checksum "Gemfile.lock" }}
104+ paths :
105+ - ~/gems
106+ - run :
107+ name : Copy key
108+ command : |
109+ if [ -z "$MASTER_KEY" ]; then rm config/credentials.yml.enc; else echo "$MASTER_KEY" > config/master.key; fi
110+ - run :
111+ name : Prepare config & database
112+ environment :
113+ RAILS_ENV : test
114+ command : |
115+ cp config/database.sample.yml config/database.yml
116+ cp config/storage.sample.yml config/storage.yml
117+ bundle exec rails db:create
118+ bundle exec rails db:schema:load
119+ bundle exec rails db:migrate
120+ bundle exec rails test:prepare
121+ - run :
122+ name : Current revision
123+ command : |
124+ git rev-parse $(git rev-parse --abbrev-ref HEAD)
125+ - run :
126+ name : Test
127+ command : |
128+ bundle exec rails test:system
129+ - store_test_results :
130+ path : " ~/qpixel/test/reports"
131+ - store_artifacts :
132+ path : " ~/qpixel/tmp/screenshots"
133+ when : on_fail
134+
135+ test-ruby31 :
136+ docker :
137+ - image : cimg/ruby:3.1-node
138+ - image : cimg/mysql:8.0
139+ command : [ --default-authentication-plugin=mysql_native_password ]
140+ environment :
141+ MYSQL_ROOT_HOST : ' %'
142+ MYSQL_ROOT_PASSWORD : ' root'
143+ MYSQL_DATABASE : ' qpixel_test'
144+ - image : cimg/redis:7.0
145+
146+ working_directory : ~/qpixel
147+
148+ steps :
149+ - run :
150+ name : Install packages
151+ command : |
152+ sudo apt-get --allow-releaseinfo-change -qq update
153+ sudo apt-get -y install git libmariadb-dev libmagickwand-dev
154+ - checkout
155+ - restore_cache :
156+ keys :
157+ - qpixel-ruby31-{{ checksum "Gemfile.lock" }}
158+ - qpixel-ruby31-
159+ - run :
160+ name : Install Bundler & gems
161+ command : |
162+ gem install bundler
163+ bundle install --path=~/gems
164+ - run :
165+ name : Clean unnecessary gems
166+ command : |
167+ bundle clean --force
33168 - save_cache :
34- key : qpixel-{{ checksum "Gemfile" }}
169+ key : qpixel-ruby31- {{ checksum "Gemfile.lock " }}
35170 paths :
36171 - ~/gems
37172 - run :
38173 name : Copy key
39174 command : |
40- echo "$MASTER_KEY" > config/master.key
175+ if [ -z "$MASTER_KEY" ]; then rm config/credentials.yml.enc; else echo "$MASTER_KEY" > config/master.key; fi
41176 - run :
42177 name : Prepare config & database
43178 environment :
@@ -56,17 +191,82 @@ jobs:
56191 - run :
57192 name : Coveralls token
58193 command : |
59- echo "repo_token: $COVERALLS_REPO_TOKEN" > .coveralls.yml
194+ if [ -z "$COVERALLS_REPO_TOKEN" ]; then echo "Skipping coveralls"; else echo " repo_token: $COVERALLS_REPO_TOKEN" > .coveralls.yml; fi
60195 - run :
61196 name : Test
62197 command : |
63198 bundle exec rails test
64199 - store_test_results :
65200 path : " ~/qpixel/test/reports"
201+ system-test-ruby31 :
202+ docker :
203+ - image : cimg/ruby:3.1-browsers
204+ - image : cimg/mysql:8.0
205+ command : [ --default-authentication-plugin=mysql_native_password ]
206+ environment :
207+ MYSQL_ROOT_HOST : ' %'
208+ MYSQL_ROOT_PASSWORD : ' root'
209+ MYSQL_DATABASE : ' qpixel_test'
210+ - image : cimg/redis:7.0
211+
212+ working_directory : ~/qpixel
213+
214+ steps :
215+ - run :
216+ name : Install packages
217+ command : |
218+ sudo apt-get --allow-releaseinfo-change -qq update
219+ sudo apt-get -y install git libmariadb-dev libmagickwand-dev
220+ - checkout
221+ - restore_cache :
222+ keys :
223+ - qpixel-ruby31-{{ checksum "Gemfile.lock" }}
224+ - qpixel-ruby31-
225+ - run :
226+ name : Install Bundler & gems
227+ command : |
228+ gem install bundler
229+ bundle install --path=~/gems
230+ - run :
231+ name : Clean unnecessary gems
232+ command : |
233+ bundle clean --force
234+ - save_cache :
235+ key : qpixel-ruby31-{{ checksum "Gemfile.lock" }}
236+ paths :
237+ - ~/gems
238+ - run :
239+ name : Copy key
240+ command : |
241+ if [ -z "$MASTER_KEY" ]; then rm config/credentials.yml.enc; else echo "$MASTER_KEY" > config/master.key; fi
242+ - run :
243+ name : Prepare config & database
244+ environment :
245+ RAILS_ENV : test
246+ command : |
247+ cp config/database.sample.yml config/database.yml
248+ cp config/storage.sample.yml config/storage.yml
249+ bundle exec rails db:create
250+ bundle exec rails db:schema:load
251+ bundle exec rails db:migrate
252+ bundle exec rails test:prepare
253+ - run :
254+ name : Current revision
255+ command : |
256+ git rev-parse $(git rev-parse --abbrev-ref HEAD)
257+ - run :
258+ name : Test
259+ command : |
260+ bundle exec rails test:system
261+ - store_test_results :
262+ path : " ~/qpixel/test/reports"
263+ - store_artifacts :
264+ path : " ~/qpixel/tmp/screenshots"
265+ when : on_fail
66266
67267 rubocop :
68268 docker :
69- - image : cimg/ruby:2.7 -node
269+ - image : cimg/ruby:3.1 -node
70270
71271 working_directory : ~/qpixel
72272
@@ -79,15 +279,19 @@ jobs:
79279 - checkout
80280 - restore_cache :
81281 keys :
82- - qpixel-{{ checksum "Gemfile" }}
83- - qpixel-
282+ - qpixel-ruby31- {{ checksum "Gemfile.lock " }}
283+ - qpixel-ruby31-
84284 - run :
85285 name : Install Bundler & gems
86286 command : |
87287 gem install bundler
88288 bundle install --path=~/gems
289+ - run :
290+ name : Clean unnecessary gems
291+ command : |
292+ bundle clean --force
89293 - save_cache :
90- key : qpixel-{{ checksum "Gemfile" }}
294+ key : qpixel-ruby31- {{ checksum "Gemfile.lock " }}
91295 paths :
92296 - ~/gems
93297 - run :
97301
98302 deploy :
99303 docker :
100- - image : cimg/ruby:2.7 -node
304+ - image : cimg/ruby:3.1 -node
101305
102306 working_directory : ~/qpixel
103307
@@ -115,11 +319,17 @@ jobs:
115319workflows :
116320 test_lint :
117321 jobs :
118- - test
322+ - test-ruby27
323+ - test-ruby31
324+ - system-test-ruby27
325+ - system-test-ruby31
119326 - rubocop
120327 - deploy :
121328 requires :
122- - test
329+ - test-ruby27
330+ - test-ruby31
331+ - system-test-ruby27
332+ - system-test-ruby31
123333 - rubocop
124334 filters :
125335 branches :
0 commit comments