Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Massongit patch 4 #133

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 1 addition & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,56 +20,5 @@ jobs:
github_token: ${{ secrets.github_token }}
skip_install: 'true'
use_bundler: 'true'
filter_mode: nofilter
- run: test "$(bundle exec rubocop --version)" == "1.65.0"
test-only_changed:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
env:
INPUT_ONLY_CHANGED: 'true'
steps:
- uses: actions/checkout@v4
- name: setup
run: |
git config user.email "[email protected]"
git config user.name "I am an automated workflow"
- name: Check when there are relevant files
run: |
git checkout ${{ github.sha }}
rm -f test/only_changed/reviewdog-was-called

cp test/only_changed/few_relevant/files/* .
git add *
git commit -m auto

export PATH=test/only_changed/few_relevant/mock_bins:test/only_changed/shared_mock_bins:$PATH
BASE_REF=$(git rev-parse HEAD~) HEAD_REF=$(git rev-parse HEAD) ./script.sh

[ -f test/only_changed/reviewdog-was-called ]
- name: Check when there are no relevant files
run: |
git checkout ${{ github.sha }}
rm -f test/only_changed/reviewdog-was-called

cp test/only_changed/nothing_relevant/files/* .
git add *
git commit -m auto

export PATH=test/only_changed/nothing_relevant/mock_bins:test/only_changed/shared_mock_bins:$PATH
BASE_REF=$(git rev-parse HEAD~) HEAD_REF=$(git rev-parse HEAD) ./script.sh

[ ! -f test/only_changed/reviewdog-was-called ]
- name: Check when there are too many relevant files
run: |
git checkout ${{ github.sha }}
rm -f test/only_changed/reviewdog-was-called

touch a{00..100}.rb
git add *
git commit -m auto

export PATH=test/only_changed/too_many_relevant/mock_bins:test/only_changed/shared_mock_bins:$PATH
BASE_REF=$(git rev-parse HEAD~) HEAD_REF=$(git rev-parse HEAD) ./script.sh

[ -f test/only_changed/reviewdog-was-called ]
2 changes: 1 addition & 1 deletion script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ echo '::group:: Running rubocop with reviewdog 🐶 ...'
${BUNDLE_EXEC}rubocop \
--require ${GITHUB_ACTION_PATH}/rdjson_formatter/rdjson_formatter.rb \
--format RdjsonFormatter \
--fail-level error \
--fail-level info \
${INPUT_RUBOCOP_FLAGS} \
"${CHANGED_FILES[@]}" \
| reviewdog -f=rdjson \
Expand Down
Loading