version: 2.1 executors: default: parameters: ruby_version: type: enum enum: ['2.3', '2.4', '2.5', '2.6'] docker: - image: ruby:<< parameters.ruby_version >>-alpine working_directory: /work commands: setup_requirements: steps: - run: name: Install System Dependencies command: | # See also https://circleci.com/docs/2.0/custom-images/#adding-required-and-custom-tools-or-files apk add --update-cache --no-cache --no-progress git openssh-client tar gzip ca-certificates \ build-base tzdata - run: name: Set timezone to Asia/Tokyo command: cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime restore_bundle_cache: parameters: ruby_version: type: enum enum: ['2.3', '2.4', '2.5', '2.6'] steps: - restore_cache: name: Restore bundle cache keys: - gems-ruby<< parameters.ruby_version >>-{{ .Environment.COMMON_CACHE_KEY }}-{{ checksum "Gemfile.lock" }} - gems-ruby<< parameters.ruby_version >>-{{ .Environment.COMMON_CACHE_KEY }}- save_bundle_cache: parameters: ruby_version: type: enum enum: ['2.3', '2.4', '2.5', '2.6'] steps: - save_cache: name: Save bundle cache key: gems-ruby<< parameters.ruby_version >>-{{ .Environment.COMMON_CACHE_KEY }}-{{ checksum "Gemfile.lock" }} paths: - /usr/local/bundle jobs: build: parameters: ruby_version: type: enum enum: ['2.3', '2.4', '2.5', '2.6'] executor: name: default ruby_version: << parameters.ruby_version >> steps: - setup_requirements - checkout - restore_bundle_cache: ruby_version: << parameters.ruby_version >> - run: name: bundle install command: | bundle check || bundle install --jobs=4 --retry=3 bundle clean - save_bundle_cache: ruby_version: << parameters.ruby_version >> - run: rubocop - run: rspec continuous_bundle_update: executor: name: default ruby_version: '2.6' steps: - setup_requirements - checkout - restore_bundle_cache: ruby_version: '2.6' - run: name: Install edge circleci-bundle-update-pr command: | gem install -N specific_install gem specific_install https://github.com/masutaka/circleci-bundle-update-pr.git - deploy: name: Run circleci-bundle-update-pr command: circleci-bundle-update-pr CircleCI circleci@example.com $CIRCLE_BRANCH workflows: version: 2 ordinary: jobs: - build: name: ruby-2.3 ruby_version: '2.3' - build: name: ruby-2.4 ruby_version: '2.4' - build: name: ruby-2.5 ruby_version: '2.5' - build: name: ruby-2.6 ruby_version: '2.6' nightly: triggers: - schedule: cron: "00 10 * * 5" filters: branches: only: master jobs: - continuous_bundle_update