summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-06-03 15:08:03 +0200
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-06-03 15:08:03 +0200
commit315ce5b3ccaf12a1dcbc26dfb9994feeb96189bf (patch)
tree8582012cfdd316a7a3ff5e69f2d76df4ea90d237
parent1637e178b8bae13fb92456570e23243c7ddc7cba (diff)
downloadgitlab-ce-faster-ci.tar.gz
Faster specsfaster-ci
-rw-r--r--.gitlab-ci.yml49
-rw-r--r--Gemfile17
2 files changed, 45 insertions, 21 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 85730e1b687..10377d02f57 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,9 +1,5 @@
image: "ruby:2.1"
-services:
- - mysql:latest
- - redis:latest
-
cache:
key: "ruby21"
paths:
@@ -11,56 +7,67 @@ cache:
variables:
MYSQL_ALLOW_EMPTY_PASSWORD: "1"
- # retry tests only in CI environment
- RSPEC_RETRY_RETRY_COUNT: "3"
+ RSPEC_RETRY_RETRY_COUNT: "3" # retry tests only in CI environment
before_script:
- - source ./scripts/prepare_build.sh
- - ruby -v
- which ruby
- retry gem install bundler --no-ri --no-rdoc
- - cp config/gitlab.yml.example config/gitlab.yml
- touch log/application.log
- touch log/test.log
- - retry bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}"
- - RAILS_ENV=test bundle exec rake db:drop db:create db:schema:load db:migrate
stages:
- test
- notifications
+.db_template: &prepare_test # Hidden job that defines an anchor named 'job_definition'
+ services:
+ - mysql:latest
+ - redis:latest
+ script:
+ - source ./scripts/prepare_build.sh
+ - cp config/gitlab.yml.example config/gitlab.yml
+ - RAILS_ENV=test bundle exec rake db:drop db:create db:schema:load db:migrate
+ - bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}" --retry=3
+
spec:feature:
+ <<: *prepare_test
stage: test
script:
- RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:feature
spec:api:
+ <<: *prepare_test
stage: test
script:
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:api
spec:models:
+ <<: *prepare_test
stage: test
script:
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:models
spec:lib:
+ <<: *prepare_test
stage: test
script:
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:lib
spec:services:
+ <<: *prepare_test
stage: test
script:
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:services
spec:other:
+ <<: *prepare_test
stage: test
script:
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:other
spinach:project:half:
+ <<: *prepare_test
stage: test
script:
- RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
@@ -73,6 +80,7 @@ spinach:project:rest:
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:rest
spinach:other:
+ <<: *prepare_test
stage: test
script:
- RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
@@ -86,26 +94,31 @@ teaspoon:
rubocop:
stage: test
script:
+ - bundle install --with rubocop --jobs $(nproc)
- bundle exec rubocop
scss-lint:
stage: test
script:
+ - bundle install --with scss_lint --jobs $(nproc)
- bundle exec rake scss_lint
brakeman:
stage: test
script:
+ - bundle install --with brakeman --jobs $(nproc)
- bundle exec rake brakeman
flog:
stage: test
script:
+ - bundle install --with flog --jobs $(nproc)
- bundle exec rake flog
flay:
stage: test
script:
+ - bundle install --with flay --jobs $(nproc)
- bundle exec rake flay
bundler:audit:
@@ -113,16 +126,18 @@ bundler:audit:
only:
- master
script:
+ - bundle install --with bundler_audit
- "bundle exec bundle-audit check --update --ignore OSVDB-115941"
db-migrate-reset:
+ <<: *prepare_test
stage: test
script:
- - RAILS_ENV=test bundle exec rake db:migrate:reset
+ - RAILS_ENV=test bundle exec rake db:migrate
# Ruby 2.2 jobs
-
spec:feature:ruby22:
+ <<: *prepare_test
stage: test
image: ruby:2.2
only:
@@ -136,6 +151,7 @@ spec:feature:ruby22:
- vendor
spec:api:ruby22:
+ <<: *prepare_test
stage: test
image: ruby:2.2
only:
@@ -148,6 +164,7 @@ spec:api:ruby22:
- vendor
spec:models:ruby22:
+ <<: *prepare_test
stage: test
image: ruby:2.2
only:
@@ -160,6 +177,7 @@ spec:models:ruby22:
- vendor
spec:lib:ruby22:
+ <<: *prepare_test
stage: test
image: ruby:2.2
only:
@@ -172,6 +190,7 @@ spec:lib:ruby22:
- vendor
spec:services:ruby22:
+ <<: *prepare_test
stage: test
image: ruby:2.2
only:
@@ -184,6 +203,7 @@ spec:services:ruby22:
- vendor
spec:other:ruby22:
+ <<: *prepare_test
stage: test
image: ruby:2.2
only:
@@ -196,6 +216,7 @@ spec:other:ruby22:
- vendor
spinach:project:half:ruby22:
+ <<: *prepare_test
stage: test
image: ruby:2.2
only:
@@ -209,6 +230,7 @@ spinach:project:half:ruby22:
- vendor
spinach:project:rest:ruby22:
+ <<: *prepare_test
stage: test
image: ruby:2.2
only:
@@ -222,6 +244,7 @@ spinach:project:rest:ruby22:
- vendor
spinach:other:ruby22:
+ <<: *prepare_test
stage: test
image: ruby:2.2
only:
diff --git a/Gemfile b/Gemfile
index d9429de786f..8c7a244c8d8 100644
--- a/Gemfile
+++ b/Gemfile
@@ -243,7 +243,6 @@ end
group :development do
gem "foreman"
- gem 'brakeman', '~> 3.2.0', require: false
gem 'letter_opener_web', '~> 1.3.0'
gem 'quiet_assets', '~> 1.0.2'
@@ -295,14 +294,16 @@ group :development, :test do
gem 'spring-commands-spinach', '~> 1.1.0'
gem 'spring-commands-teaspoon', '~> 0.0.2'
- gem 'rubocop', '~> 0.40.0', require: false
- gem 'rubocop-rspec', '~> 1.5.0', require: false
- gem 'scss_lint', '~> 0.47.0', require: false
- gem 'coveralls', '~> 0.8.2', require: false
+ gem 'rubocop', '~> 0.40.0', require: false, group: :rubocop
+ gem 'rubocop-rspec', '~> 1.5.0', require: false, group: :rubocop
+ gem 'scss_lint', '~> 0.47.0', require: false, group: :scss_lint
+ gem 'flog', require: false, group: :flog
+ gem 'flay', require: false, group: :flay
+ gem 'bundler-audit', require: false, group: :bundler_audit
+ gem 'brakeman', '~> 3.2.0', require: false, group: :brakeman
+
gem 'simplecov', '~> 0.11.0', require: false
- gem 'flog', require: false
- gem 'flay', require: false
- gem 'bundler-audit', require: false
+ gem 'coveralls', '~> 0.8.2', require: false
gem 'benchmark-ips', require: false
end