diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml new file mode 100644 index 0000000..4ee8bde --- /dev/null +++ b/.github/workflows/rubocop.yml @@ -0,0 +1,36 @@ +name: Run RuboCop + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - name: Set up Ruby 2.6 + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6.x + + - name: Set Gemfile + run: | + echo "">> Gemfile + echo "group :development, :test do">> Gemfile + echo " gem 'rubocop', require: false" >> Gemfile + echo " gem 'rubocop-performance', require: false" >> Gemfile + echo " gem 'rubocop-rails', require: false" >> Gemfile + echo "end">> Gemfile + + - name: Setup gems + run: | + gem install bundler + bundle install --jobs 4 --retry 3 + + - name: Run RuboCop + run: | + gem install bundler + bundle install --jobs 4 --retry 3 + bundle exec rubocop diff --git a/Gemfile b/Gemfile index 474e102..6933345 100644 --- a/Gemfile +++ b/Gemfile @@ -2,5 +2,7 @@ gem 'slim-rails' gem 'validate_url' group :development, :test do - gem 'brakeman', require: false + gem 'rubocop', require: false + gem 'rubocop-performance', require: false + gem 'rubocop-rails', require: false end