Skip to content

Commit

Permalink
Update rubocop to run on changed files (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
tian-im committed Sep 7, 2023
1 parent a94b74a commit 6bdbd3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Setup Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -67,12 +69,13 @@ jobs:
bundler-cache: true

- name: Rubocop Check
run: bundle exec rubocop
if: ${{ github.event_name == 'pull_request' }}
run: git diff --name-only ${{ github.event.pull_request.base.sha }} --diff-filter AMT | xargs bundle exec rubocop --force-exclusion

- name: Rspec
run: |
if [ "$GITHUB_REF_NAME" = "main" ]; then curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; fi
if [ "$GITHUB_REF_NAME" = "main" ]; then chmod +x ./cc-test-reporter; fi
if [ "$GITHUB_REF_NAME" = "main" ]; then ./cc-test-reporter before-build; fi
if [ "$GITHUB_BASE_REF" = "main" ]; then curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; fi
if [ "$GITHUB_BASE_REF" = "main" ]; then chmod +x ./cc-test-reporter; fi
if [ "$GITHUB_BASE_REF" = "main" ]; then ./cc-test-reporter before-build; fi
bundle exec rake --trace db:test:prepare spec
if [ "$GITHUB_REF_NAME" = "main" ]; then ./cc-test-reporter after-build -r ${{ env.CC_TEST_REPORTER_ID }}; fi
if [ "$GITHUB_BASE_REF" = "main" ]; then ./cc-test-reporter after-build -r ${{ env.CC_TEST_REPORTER_ID }}; fi
2 changes: 1 addition & 1 deletion spec/requests/wallaby/error_handling_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
get '/admin/unknown_model'
expect(response).to have_http_status :not_found
expect(response).to render_template :error
expect(response.body).to include 'Model unknown_model cannot be found.'
expect(response.body).to include 'Model UnknownModel cannot be found.'
end

it 'shows not found page for array' do
Expand Down

0 comments on commit 6bdbd3f

Please sign in to comment.