fix: Remove lint-action github action and add custom RuboCop action

- Annotations feature provided by lint-action is not working with PRs 
from fork repos
- pull_request_target feature is also not behaving reliably 
- Remove hound
- Not using bundler-cache: true for caching as it uses uses 
./vendor/bundle as bundle path and rubocop lint vendor as well. So 
caching under ../vendor/bundle using actions/cache
- Using actions/cache@v1 rather v2 as gems are not getting cached due to 
unknown reason
This commit is contained in:
Kapil Sachdev 2020-11-17 01:41:33 +05:30
parent 91f57a3016
commit bf41204490
3 changed files with 20 additions and 33 deletions

View File

@ -1,38 +1,30 @@
name: Rubocop name: RuboCop
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
run-linters: build:
name: Run linters
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out Git repository - name: Checkout Repository
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set up Ruby - name: Setup Ruby
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.2
- name: Set up bundle cache - name: Cache gems
uses: actions/cache@v2 uses: actions/cache@v1
with: with:
path: /vendor/bundle path: ../vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('./Gemfile.lock') }} key: ${{ runner.os }}-rubocop-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: | restore-keys: |
${{ runner.os }}-gems- ${{ runner.os }}-rubocop-
- name: Install Ruby dependencies - name: Install gems
run: | run: |
bundle config path /vendor/bundle bundle config path ../vendor/bundle
bundle install --jobs 4 --retry 3 bundle install --jobs 4 --retry 3
- name: Run linters - name: Run RuboCop
uses: wearerequired/lint-action@v1 run: bundle exec rubocop --parallel
with:
github_token: ${{ secrets.github_token }}
rubocop: true
rubocop_command_prefix: bundle exec
rubocop_args: -c ./.rubocop.yml

View File

@ -1,3 +0,0 @@
ruby:
enabled: true
config_file: .rubocop.yml

View File

@ -1,4 +1,4 @@
# Shoulda Matchers [![Gem Version][version-badge]][rubygems] [![Build Status][travis-badge]][travis] [![Total Downloads][downloads-total]][rubygems] [![Downloads][downloads-badge]][rubygems] [![Hound][hound-badge]][hound] # Shoulda Matchers [![Gem Version][version-badge]][rubygems] [![Build Status][travis-badge]][travis] [![Total Downloads][downloads-total]][rubygems] [![Downloads][downloads-badge]][rubygems]
[version-badge]: https://img.shields.io/gem/v/shoulda-matchers.svg [version-badge]: https://img.shields.io/gem/v/shoulda-matchers.svg
[rubygems]: https://rubygems.org/gems/shoulda-matchers [rubygems]: https://rubygems.org/gems/shoulda-matchers
@ -7,8 +7,6 @@
[downloads-total]: https://img.shields.io/gem/dt/shoulda-matchers.svg [downloads-total]: https://img.shields.io/gem/dt/shoulda-matchers.svg
[downloads-badge]: https://img.shields.io/gem/dtv/shoulda-matchers.svg [downloads-badge]: https://img.shields.io/gem/dtv/shoulda-matchers.svg
[downloads-badge]: https://img.shields.io/gem/dtv/shoulda-matchers.svg [downloads-badge]: https://img.shields.io/gem/dtv/shoulda-matchers.svg
[hound-badge]: https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg
[hound]: https://houndci.com
[![shoulda-matchers][logo]][website] [![shoulda-matchers][logo]][website]