From f4b62005b4c090730801d10b26c48df3c9aa7f80 Mon Sep 17 00:00:00 2001 From: Alexander Meindl Date: Wed, 25 Mar 2020 19:42:14 +0100 Subject: [PATCH] Use github actions for rubocop --- .github/workflows/rubocop.yml | 36 +++++++++++++++++++++++++++++++++++ Gemfile | 4 +++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/rubocop.yml 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