version: 2.1

orbs:
  ruby-orbs: sue445/ruby-orbs@volatile
  slack:     circleci/slack@3

executors:
  default:
    docker:
      - image: cimg/ruby:3.1.2
        environment:
          RACK_ENV: test
    working_directory: ~/app

jobs:
  rspec:
    executor:
      name: default

    steps:
      - checkout
      - ruby-orbs/bundle-install:
          cache_key_prefix: "v2-bundle"
      - run: bundle exec rspec
      - slack/notify-on-failure

  rubocop:
    executor:
      name: default

    steps:
      - checkout
      - ruby-orbs/bundle-install:
          cache_key_prefix: "v2-bundle"
      - run: bundle exec rubocop
      - slack/notify-on-failure

  bot_birthday:
    executor:
      name: default

    steps:
      - checkout
      - ruby-orbs/bundle-install:
          cache_key_prefix: "v2-bundle"
      - run: bundle exec rake bot:birthday
      - slack/notify-on-failure

workflows:
  version: 2

  build:
    jobs:
      - rspec
      - rubocop

  daily_tweet:
    triggers:
      - schedule:
          cron: "0 15 * * *" # 0:00 (JST)
          filters:
            branches:
              only:
                - master
    jobs:
      - bot_birthday

version: 2.1

orbs:
  ruby-orbs: sue445/ruby-orbs@volatile
  slack:     circleci/slack@3

executors:
  default:
    docker:
      - image: cimg/ruby:3.1
        environment:
          RACK_ENV: test
    working_directory: ~/app

jobs:
  rspec:
    executor:
      name: default

    steps:
      - checkout
      - ruby-orbs/bundle-install:
          cache_key_prefix: "v2-bundle"
      - run: bundle exec rspec
      - slack/notify-on-failure

  rubocop:
    executor:
      name: default

    steps:
      - checkout
      - ruby-orbs/bundle-install:
          cache_key_prefix: "v2-bundle"
      - run: bundle exec rubocop
      - slack/notify-on-failure

  bot_birthday:
    executor:
      name: default

    steps:
      - checkout
      - ruby-orbs/bundle-install:
          cache_key_prefix: "v2-bundle"
      - run: bundle exec rake bot:birthday
      - slack/notify-on-failure

workflows:
  version: 2

  build:
    jobs:
      - rspec
      - rubocop

  daily_tweet:
    triggers:
      - schedule:
          cron: "0 15 * * *" # 0:00 (JST)
          filters:
            branches:
              only:
                - master
    jobs:
      - bot_birthday

Upgrade to Ruby 3.1 :gem:
Upgrade to Ruby 3.1 :gem:
