Commit cf4c9b49 authored by Z.J. van de Weg's avatar Z.J. van de Weg

Use YAML inheritance to DRY the .gitlab-ci.yml

parent a697b3c5
...@@ -63,11 +63,14 @@ update-knapsack: ...@@ -63,11 +63,14 @@ update-knapsack:
# Execute all testing suites # Execute all testing suites
.rspec-knapsack: &rspec-knapsack .use-db: &use-db
stage: test
services: services:
- mysql:latest - mysql:latest
- redis:alpine - redis:alpine
.rspec-knapsack: &rspec-knapsack
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 )
...@@ -83,9 +86,7 @@ update-knapsack: ...@@ -83,9 +86,7 @@ update-knapsack:
.spinach-knapsack: &spinach-knapsack .spinach-knapsack: &spinach-knapsack
stage: test stage: test
services: <<: *use-db
- mysql:latest
- redis:alpine
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 )
...@@ -134,9 +135,7 @@ spinach 9 10: *spinach-knapsack ...@@ -134,9 +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"
services: <<: *use-db
- mysql:latest
- redis:alpine
only: only:
- master - master
cache: cache:
...@@ -187,11 +186,14 @@ spinach 9 10 ruby23: *spinach-knapsack-ruby23 ...@@ -187,11 +186,14 @@ spinach 9 10 ruby23: *spinach-knapsack-ruby23
# Other generic tests # Other generic tests
.exec: &exec .static-analyses-variables: &static-analyses-variables
variables: variables:
SIMPLECOV: "false" SIMPLECOV: "false"
USE_DB: "false" USE_DB: "false"
USE_BUNDLE_INSTALL: "true" USE_BUNDLE_INSTALL: "true"
.exec: &exec
<<: *static-analyses-variables
stage: test stage: test
script: script:
- bundle exec $CI_BUILD_NAME - bundle exec $CI_BUILD_NAME
...@@ -205,26 +207,19 @@ license_finder: *exec ...@@ -205,26 +207,19 @@ license_finder: *exec
rake db:migrate:reset: rake db:migrate:reset:
stage: test stage: test
services: <<: *use-db
- mysql:latest
- redis:alpine
script: script:
- rake db:migrate:reset - rake db:migrate:reset
teaspoon: teaspoon:
stage: test stage: test
services: <<: *use-db
- mysql:latest
- redis:alpine
script: script:
- teaspoon - teaspoon
bundler:audit: bundler:audit:
stage: test stage: test
variables: <<: *static-analyses-variables
SIMPLECOV: "false"
USE_DB: "false"
USE_BUNDLE_INSTALL: "true"
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