version: 2.1 orbs: ruby: circleci/ruby@0.2.1 sonarcloud: sonarsource/sonarcloud@1.0.1 jobs: "rubocop": docker: - image: circleci/ruby:2.7-node steps: - checkout - ruby/load-cache - ruby/install-deps - run: name: Run Rubocop command: bundle exec rubocop - ruby/save-cache "ruby-two-five": docker: - image: circleci/ruby:2.5 - image: circleci/mysql:5.7 environment: MYSQL_DATABASE: 'legion' MYSQL_ROOT_PASSWORD: 'legion' MYSQL_USER: 'legion' MYSQL_PASSWORD: 'legion' steps: - checkout - ruby/load-cache - run: name: update bundler command: gem update bundler - ruby/install-deps - run: name: update max connections command: 'sudo apt-get install default-mysql-client && mysql -h 127.0.0.1 -u root --password=legion --execute="set global max_connections = 100000;"' - ruby/run-tests - ruby/save-cache "ruby-two-six": docker: - image: circleci/ruby:2.6 - image: circleci/mysql:5.7 environment: MYSQL_DATABASE: 'legion' MYSQL_ROOT_PASSWORD: 'legion' MYSQL_USER: 'legion' MYSQL_PASSWORD: 'legion' steps: - checkout - ruby/load-cache - run: name: update bundler command: gem update bundler - ruby/install-deps - run: name: update max connections command: 'sudo apt-get install default-mysql-client && mysql -h 127.0.0.1 -u root --password=legion --execute="set global max_connections = 100000;"' - ruby/run-tests - ruby/save-cache "ruby-two-seven": docker: - image: circleci/ruby:2.7 - image: circleci/mysql:5.7 environment: MYSQL_DATABASE: 'legion' MYSQL_ROOT_PASSWORD: 'legion' MYSQL_USER: 'legion' MYSQL_PASSWORD: 'legion' steps: - checkout - ruby/load-cache - ruby/install-deps - run: name: update max connections command: 'sudo apt-get install default-mysql-client && mysql -h 127.0.0.1 -u root --password=legion --execute="set global max_connections = 100000;"' - ruby/run-tests - ruby/save-cache "jruby-nine-two": docker: - image: circleci/jruby:9.2-jre - image: circleci/mysql:5.7 environment: MYSQL_DATABASE: 'legion' MYSQL_ROOT_PASSWORD: 'legion' MYSQL_USER: 'legion' MYSQL_PASSWORD: 'legion' steps: - checkout - run: name: Bundle Install command: bundle install - run: name: update max connections command: 'sudo apt-get install default-mysql-client && mysql -h 127.0.0.1 -u root --password=legion --execute="set global max_connections = 100000;"' - run: name: Run RSpec command: bundle exec rspec --format progress --format RspecJunitFormatter -o test-results/rspec/results.xml when: always - sonarcloud/scan "jruby-nine-two-e": docker: - image: circleci/jruby:9.2.11-jre - image: circleci/mysql:5.7 environment: MYSQL_DATABASE: 'legion' MYSQL_ROOT_PASSWORD: 'legion' MYSQL_USER: 'legion' MYSQL_PASSWORD: 'legion' steps: - checkout - run: name: Bundle Install command: bundle install - run: name: update max connections command: 'sudo apt-get install default-mysql-client && mysql -h 127.0.0.1 -u root --password=legion --execute="set global max_connections = 100000;"' - run: name: Run RSpec command: bundle exec rspec --format progress --format RspecJunitFormatter -o test-results/rspec/results.xml when: always "sonarcloud": docker: - image: circleci/ruby:2.7 - image: circleci/mysql:5.7 environment: MYSQL_DATABASE: 'legion' MYSQL_ROOT_PASSWORD: 'legion' MYSQL_USER: 'legion' MYSQL_PASSWORD: 'legion' steps: - checkout - ruby/load-cache - run: name: update bundler command: gem update bundler - ruby/install-deps - run: name: update max connections command: 'sudo apt-get install default-mysql-client && mysql -h 127.0.0.1 -u root --password=legion --execute="set global max_connections = 100000;"' - ruby/run-tests - run: name: Run Rubocop command: bundle exec rubocop --format=json --out=rubocop-result.json - sonarcloud/scan - ruby/save-cache workflows: version: 2 rubocop-rspec: jobs: - rubocop - ruby-two-five: requires: - rubocop - ruby-two-six: requires: - ruby-two-five - ruby-two-seven: requires: - ruby-two-five - sonarcloud: requires: - ruby-two-seven - ruby-two-six - jruby-nine-two: requires: - ruby-two-seven - ruby-two-six - jruby-nine-two-e: requires: - jruby-nine-two