Skip to content

Add Ruby development container setup with Rubocop integration #132

Add Ruby development container setup with Rubocop integration

Add Ruby development container setup with Rubocop integration #132

Workflow file for this run

name: CI
on: [pull_request]
jobs:
test-skip-install-and-use-bundler:
runs-on: ubuntu-latest
defaults:
run:
working-directory: test/using_bundler
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/test/using_bundler/Gemfile
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: rubocop with skip install and using bundler
uses: ./
with:
github_token: ${{ secrets.github_token }}
skip_install: 'true'
use_bundler: 'true'
- 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 ]