image: ruby:2.7 stages: - build - test - lint - release variables: BUNDLE_PATH: .bundle/vendor cache: &cache policy: pull-push key: files: - Gemfile.lock paths: - CLI/ruby/.bundle/vendor before_script: - cd CLI/ruby - bundle install -j $(nproc) build: stage: build script: - ruby -v - bundle env test: stage: test needs: [build] cache: <<: *cache policy: pull script: - bundle exec rspec lint: stage: test needs: [build] cache: <<: *cache policy: pull script: - bundle exec rubocop release: stage: release needs: [test, lint] rules: - if: $CI_COMMIT_TAG =~ /^ruby\/v.*$/ cache: <<: *cache policy: pull script: - bundle exec rake clean - bundle exec rake clobber - bundle exec rake build - bundle exec gem push pkg/terminal_game_of_life-*.gem