image: ruby:2.6.6 stages: - lint - test - analysis cache: paths: - vendor/ruby .install_ruby_gems: &install_ruby_gems - gem install bundler -v 2.1.4 - bundle install --path vendor before_script: - *install_ruby_gems rubocop: stage: lint script: - bundle exec rubocop except: - schedules bundler-audit: stage: lint before_script: - *install_ruby_gems - gem install bundler-audit - bundle audit --update script: - bundle audit allow_failure: true rspec: stage: test script: - bundle exec rspec except: - schedules sonarqube: stage: analysis image: registry.5xruby.tw/docker/sonar-scanner:4.0.0 before_script: [] script: - sonar-scanner -D"sonar.projectKey=5xruby-bankai" -D"sonar.projectBaseDir=${CI_PROJECT_DIR}" -D"sonar.host.url=https://sonar.5xruby.tw" -D"sonar.login=${SONARQUBE_TOKEN}" -D"sonar.projectVersion=${CI_COMMIT_SHORT_SHA}"