Skip to content

Commit 5a77eb1

Browse files
author
Douwe Maan
committed
Merge branch 'faster-builds-ci' into 'master'
Speed improvement for builds without DB Only fetch the images which we are going to use. Speeds up the builds by about 30-45 seconds. /cc @ayufan See merge request !4994
2 parents 5eb307a + cf4c9b4 commit 5a77eb1

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

.gitlab-ci.yml

+28-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
image: "ruby:2.1"
22

3-
services:
4-
- mysql:latest
5-
- redis:alpine
6-
73
cache:
84
key: "ruby21"
95
paths:
@@ -34,7 +30,6 @@ stages:
3430
- post-test
3531

3632
# Prepare and merge knapsack tests
37-
3833
.knapsack-state: &knapsack-state
3934
services: []
4035
variables:
@@ -68,8 +63,14 @@ update-knapsack:
6863

6964
# Execute all testing suites
7065

66+
.use-db: &use-db
67+
services:
68+
- mysql:latest
69+
- redis:alpine
70+
7171
.rspec-knapsack: &rspec-knapsack
7272
stage: test
73+
<<: *use-db
7374
script:
7475
- bundle exec rake assets:precompile 2>/dev/null
7576
- JOB_NAME=( $CI_BUILD_NAME )
@@ -85,6 +86,7 @@ update-knapsack:
8586

8687
.spinach-knapsack: &spinach-knapsack
8788
stage: test
89+
<<: *use-db
8890
script:
8991
- bundle exec rake assets:precompile 2>/dev/null
9092
- JOB_NAME=( $CI_BUILD_NAME )
@@ -133,6 +135,7 @@ spinach 9 10: *spinach-knapsack
133135
# Execute all testing suites against Ruby 2.3
134136
.ruby-23: &ruby-23
135137
image: "ruby:2.3"
138+
<<: *use-db
136139
only:
137140
- master
138141
cache:
@@ -183,23 +186,41 @@ spinach 9 10 ruby23: *spinach-knapsack-ruby23
183186

184187
# Other generic tests
185188

189+
.static-analyses-variables: &static-analyses-variables
190+
variables:
191+
SIMPLECOV: "false"
192+
USE_DB: "false"
193+
USE_BUNDLE_INSTALL: "true"
194+
186195
.exec: &exec
196+
<<: *static-analyses-variables
187197
stage: test
188198
script:
189199
- bundle exec $CI_BUILD_NAME
190200

191-
teaspoon: *exec
192201
rubocop: *exec
193202
rake scss_lint: *exec
194203
rake brakeman: *exec
195204
rake flog: *exec
196205
rake flay: *exec
197-
rake db:migrate:reset: *exec
198206
license_finder: *exec
199207
rake downtime_check: *exec
200208

209+
rake db:migrate:reset:
210+
stage: test
211+
<<: *use-db
212+
script:
213+
- rake db:migrate:reset
214+
215+
teaspoon:
216+
stage: test
217+
<<: *use-db
218+
script:
219+
- teaspoon
220+
201221
bundler:audit:
202222
stage: test
223+
<<: *static-analyses-variables
203224
only:
204225
- master
205226
script:

0 commit comments

Comments
 (0)