smptmhr / el-training

株式会社万葉の新入社員教育用カリキュラム
https://everyleaf.com/
2 stars 0 forks source link

rubocopのCIを作成する #14

Closed KessaPassa closed 2 years ago

KessaPassa commented 2 years ago

やること

pushしたときに自動的にrubocopが走るようにCIを設定する

関連PR: https://github.com/smptmhr/el-training/pull/7 参考: https://github.com/ruby/setup-ruby#single-job

完了条件

エラーが発生したので修正したこと

github actionsでbundle install時に下記のエラーが発生

Your bundle only supports platforms ["x86_64-darwin-19"] but your local platform
  is x86_64-linux. Add the current platform to the lockfile with `bundle lock
  --add-platform x86_64-linux` and try again.

x86_64-linux を追加する必要があるので bundle lock --add-platform x86_64-linux コマンドを実行した

また、Unable to find gem rubocop-discourse; is the gem installed? Gem::MissingSpecError というエラーが発生 vendor/**/* にgemがinstallされる関係上、除外することでエラーを取り除く https://qiita.com/pensuke628/items/eadfba5609aa0d4e5097

KessaPassa commented 2 years ago

@smptmhr CI設定に伴って変わったところあるので、ともにも見て欲しいです

smptmhr commented 2 years ago

x86_64-linux を追加する必要があるので bundle lock --add-platform x86_64-linux コマンドを実行した

この問題が発生した原因って、 いま作成しているアプリの仕様上なのか、 それとも個々の開発環境によるものなのか、どっちに当たりますか?