# -*- mode: yaml; -*-
# vim:set shiftwidth=2 syntax=yaml:

image: ruby:2.4

stages:
  - prepare
  - build
  - test
  - deployment

cache:
  key: "$CI_PROJECT_PATH"
  paths:
    - .bundle/
    - doc/
    - vendor/

variables:
  BUNDLE_APP_CONFIG: .bundle

before_script:
  - gem update did_you_mean
  - bundle install --deployment --jobs $(nproc --ignore=1)

rake-test:
  stage: test
  script:
    - bundle exec rake test

# -*- mode: yaml; -*-
# vim:set shiftwidth=2 syntax=yaml:

image: ruby:2.4

stages:
  - prepare
  - build
  - test
  - deployment

cache:
  key: "$CI_PROJECT_PATH"
  paths:
    - .bundle/
    - doc/
    - vendor/

variables:
  BUNDLE_APP_CONFIG: .bundle

prepare:
  stage: prepare
  script:
    - gem update did_you_mean
    - gem update bundler
    - bundle install --deployment --jobs $(nproc --ignore=1)

rake-test:
  stage: test
  script:
    - bundle exec rake test

Use prepare stage to install gem bundle
CI: Use prepare stage to install gem bundle
