Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add github action for linting rubocop [ci skip]
- Loading branch information
1 parent
a06f0ae
commit 91f57a3
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Rubocop | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
run-linters: | ||
name: Run linters | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7.2 | ||
|
||
- name: Set up bundle cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: /vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('./Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: Install Ruby dependencies | ||
run: | | ||
bundle config path /vendor/bundle | ||
bundle install --jobs 4 --retry 3 | ||
- name: Run linters | ||
uses: wearerequired/lint-action@v1 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
rubocop: true | ||
rubocop_command_prefix: bundle exec | ||
rubocop_args: -c ./.rubocop.yml |