Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Add automatic linter review action
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroPointEnergy committed Mar 9, 2020
1 parent 7efbf06 commit f73a9fc
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/code-style-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 'Code Style Review'

on:
pull_request:
branches:
- 'master'
paths-ignore:
- 'doc/**'
- '**.md'

jobs:
lint:
runs-on: 'ubuntu-latest'

steps:
- name: 'Checkout'
uses: actions/checkout@v2

- name: 'Set up Ruby'
uses: actions/setup-ruby@v1
with:
ruby-version: '2.6'

- name: 'Set up Reviewdog'
env:
REVIEWDOG_INSTALLER: 'https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh'
run: |
mkdir -p $HOME/bin
curl -sfL ${REVIEWDOG_INSTALLER} | sh -s -- -b $HOME/bin
- name: 'Set up Rubocop'
run: 'gem install rubocop rubocop-rspec rubocop-performance rubocop-rails'

- name: 'Run Rubocop'
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rubocop |
$HOME/bin/reviewdog \
-f=rubocop \
-name="Rubocop" \
-reporter=github-pr-review \
-level=error \
-diff="git diff $DIFF_BRANCH"
- name: 'Set up Haml-lint'
run: 'gem install haml-lint'

- name: 'Run Haml-lint'
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
haml-lint |
$HOME/bin/reviewdog \
-efm="%f:%l %m" \
-name="Haml-lint" \
-reporter=github-pr-review \
-level=error \
-diff="git diff $DIFF_BRANCH"

0 comments on commit f73a9fc

Please sign in to comment.