summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml56
1 files changed, 24 insertions, 32 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4e98b7a68ee..2ad63548d78 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,16 +12,18 @@ cache:
variables:
MYSQL_ALLOW_EMPTY_PASSWORD: "1"
+ # retry tests only in CI environment
+ RSPEC_RETRY_RETRY_COUNT: "3"
before_script:
- source ./scripts/prepare_build.sh
- ruby -v
- which ruby
- - gem install bundler --no-ri --no-rdoc
+ - retry gem install bundler --no-ri --no-rdoc
- cp config/gitlab.yml.example config/gitlab.yml
- touch log/application.log
- touch log/test.log
- - bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}"
+ - 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:
@@ -69,15 +71,6 @@ spec:services:
- ruby
- mysql
-spec:benchmark:
- stage: test
- script:
- - RAILS_ENV=test bundle exec rake spec:benchmark
- tags:
- - ruby
- - mysql
- allow_failure: true
-
spec:other:
stage: test
script:
@@ -89,6 +82,7 @@ spec:other:
spinach:project:half:
stage: test
script:
+ - RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:half
tags:
- ruby
@@ -97,6 +91,7 @@ spinach:project:half:
spinach:project:rest:
stage: test
script:
+ - RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:rest
tags:
- ruby
@@ -105,6 +100,7 @@ spinach:project:rest:
spinach:other:
stage: test
script:
+ - RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:other
tags:
- ruby
@@ -126,6 +122,14 @@ rubocop:
- ruby
- mysql
+scss-lint:
+ stage: test
+ script:
+ - bundle exec rake scss_lint
+ tags:
+ - ruby
+ allow_failure: true
+
brakeman:
stage: test
script:
@@ -152,13 +156,14 @@ flay:
bundler:audit:
stage: test
+ only:
+ - master
script:
- "bundle exec bundle-audit update"
- - "bundle exec bundle-audit check"
+ - "bundle exec bundle-audit check --ignore OSVDB-115941"
tags:
- ruby
- mysql
- allow_failure: true
# Ruby 2.2 jobs
@@ -166,7 +171,7 @@ spec:feature:ruby22:
stage: test
image: ruby:2.2
only:
- - master
+ - master
script:
- RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:feature
@@ -238,22 +243,6 @@ spec:services:ruby22:
- ruby
- mysql
-spec:benchmark:ruby22:
- stage: test
- image: ruby:2.2
- only:
- - master
- script:
- - RAILS_ENV=test bundle exec rake spec:benchmark
- cache:
- key: "ruby22"
- paths:
- - vendor
- tags:
- - ruby
- - mysql
- allow_failure: true
-
spec:other:ruby22:
stage: test
image: ruby:2.2
@@ -275,6 +264,7 @@ spinach:project:half:ruby22:
only:
- master
script:
+ - RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:half
cache:
key: "ruby22"
@@ -290,6 +280,7 @@ spinach:project:rest:ruby22:
only:
- master
script:
+ - RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:rest
cache:
key: "ruby22"
@@ -305,6 +296,7 @@ spinach:other:ruby22:
only:
- master
script:
+ - RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:other
cache:
key: "ruby22"
@@ -318,10 +310,10 @@ spinach:other:ruby22:
notify:slack:
stage: notifications
script:
- - ./scripts/notify_slack.sh "#builds" "Build on \`$CI_BUILD_REF_NAME\` failed! Check <https://gitlab.com/gitlab-org/$(basename "$PWD")/commit/"$CI_BUILD_REF"/builds>"
+ - ./scripts/notify_slack.sh "#builds" "Build on \`$CI_BUILD_REF_NAME\` failed! Commit \`$(git log -1 --oneline)\` See <https://gitlab.com/gitlab-org/$(basename "$PWD")/commit/"$CI_BUILD_REF"/builds>"
when: on_failure
only:
- master@gitlab-org/gitlab-ce
- tags@gitlab-org/gitlab-ce
- master@gitlab-org/gitlab-ee
- - tags@gitlab-org/gitlab-ee \ No newline at end of file
+ - tags@gitlab-org/gitlab-ee