5
0

More than 3 years have passed since last update.

CircleCIでRubocopの実行時間短縮の方法(--parallel)

Posted at

はじめに

CI上で約1700filesに対してrubocopを実行すると約3分もの時間がかかっていた。
--parallelを使うことでrubocopの実行時間を約1分に短縮が可能であった。

構成前提

  • rails (5.2.3)
  • rspec (3.9.0)
  • rubocop (0.78.0)
  • rubocop-rspec (1.37.1)
  • CircleCI (2.1)
    • Resources 2CPU/4096MB

設定例(抜粋)

.circleci/config.yml
rubocop:
    executor: ruby
    steps:
      - attach_workspace:
          at: ~/
      - run:
          name: Rubocop
          command: bundle exec rubocop --parallel

docs.rubocop.org

効果

--parallelを使う前

スクリーンショット 2020-02-25 14.04.48.png

--parallelを使った場合

スクリーンショット 2020-02-25 14.05.12.png

5
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
0