Commit 5a77eb15 authored by Douwe Maan's avatar Douwe Maan

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
parents 5eb307a1 cf4c9b49
image: "ruby:2.1" image: "ruby:2.1"
services:
- mysql:latest
- redis:alpine
cache: cache:
key: "ruby21" key: "ruby21"
paths: paths:
...@@ -34,7 +30,6 @@ stages: ...@@ -34,7 +30,6 @@ stages:
- post-test - post-test
# Prepare and merge knapsack tests # Prepare and merge knapsack tests
.knapsack-state: &knapsack-state .knapsack-state: &knapsack-state
services: [] services: []
variables: variables:
...@@ -68,8 +63,14 @@ update-knapsack: ...@@ -68,8 +63,14 @@ update-knapsack:
# Execute all testing suites # Execute all testing suites
.use-db: &use-db
services:
- mysql:latest
- redis:alpine
.rspec-knapsack: &rspec-knapsack .rspec-knapsack: &rspec-knapsack
stage: test stage: test
<<: *use-db
script: script:
- bundle exec rake assets:precompile 2>/dev/null - bundle exec rake assets:precompile 2>/dev/null
- JOB_NAME=( $CI_BUILD_NAME ) - JOB_NAME=( $CI_BUILD_NAME )
...@@ -85,6 +86,7 @@ update-knapsack: ...@@ -85,6 +86,7 @@ update-knapsack:
.spinach-knapsack: &spinach-knapsack .spinach-knapsack: &spinach-knapsack
stage: test stage: test
<<: *use-db
script: script:
- bundle exec rake assets:precompile 2>/dev/null - bundle exec rake assets:precompile 2>/dev/null
- JOB_NAME=( $CI_BUILD_NAME ) - JOB_NAME=( $CI_BUILD_NAME )
...@@ -133,6 +135,7 @@ spinach 9 10: *spinach-knapsack ...@@ -133,6 +135,7 @@ spinach 9 10: *spinach-knapsack
# Execute all testing suites against Ruby 2.3 # Execute all testing suites against Ruby 2.3
.ruby-23: &ruby-23 .ruby-23: &ruby-23
image: "ruby:2.3" image: "ruby:2.3"
<<: *use-db
only: only:
- master - master
cache: cache:
...@@ -183,23 +186,41 @@ spinach 9 10 ruby23: *spinach-knapsack-ruby23 ...@@ -183,23 +186,41 @@ spinach 9 10 ruby23: *spinach-knapsack-ruby23
# Other generic tests # Other generic tests
.static-analyses-variables: &static-analyses-variables
variables:
SIMPLECOV: "false"
USE_DB: "false"
USE_BUNDLE_INSTALL: "true"
.exec: &exec .exec: &exec
<<: *static-analyses-variables
stage: test stage: test
script: script:
- bundle exec $CI_BUILD_NAME - bundle exec $CI_BUILD_NAME
teaspoon: *exec
rubocop: *exec rubocop: *exec
rake scss_lint: *exec rake scss_lint: *exec
rake brakeman: *exec rake brakeman: *exec
rake flog: *exec rake flog: *exec
rake flay: *exec rake flay: *exec
rake db:migrate:reset: *exec
license_finder: *exec license_finder: *exec
rake downtime_check: *exec rake downtime_check: *exec
rake db:migrate:reset:
stage: test
<<: *use-db
script:
- rake db:migrate:reset
teaspoon:
stage: test
<<: *use-db
script:
- teaspoon
bundler:audit: bundler:audit:
stage: test stage: test
<<: *static-analyses-variables
only: only:
- master - master
script: script:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment