Skip to content

Commit

Permalink
Run Rubocop only once in CI
Browse files Browse the repository at this point in the history
No need to keep running rubocop, can esp. even be a bit slow on
JRuby
  • Loading branch information
PragTob committed Apr 15, 2024
1 parent 0c27173 commit e024e75
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/stable.yml
Expand Up @@ -29,13 +29,17 @@ jobs:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Run Rubocop
run: bundle exec rake rubocop
# code style is enough to check once (and might even take some time on JRuby)
if: matrix.ruby-version != '3.3'

- name: Run tests
run: bundle exec rake
run: bundle exec rake test
if: matrix.ruby-version != 'truffleruby'

# Run only `rake spec` on truffleruby, because just `rake` runs `rubocop spec cucumber`.
# There is no value to rerun rubocop here.
# cucumber fails because it uses an old childprocess which depends on fork.
# Run only `rake spec` on truffleruby, because just `rake` runs cucumber
# which fails because it uses an old childprocess which depends on fork.
- name: Run specs (truffleruby)
run: bundle exec rake spec
if: matrix.ruby-version == 'truffleruby'
7 changes: 3 additions & 4 deletions .github/workflows/unstable.yml
Expand Up @@ -28,12 +28,11 @@ jobs:
bundler-cache: true

- name: Run tests
run: bundle exec rake
run: bundle exec rake test
if: matrix.ruby-version != 'truffleruby-head'

# Run only `rake spec` on truffleruby, because just `rake` runs `rubocop spec cucumber`.
# There is no value to rerun rubocop here.
# cucumber fails because it uses an old childprocess which depends on fork.
# Run only `rake spec` on truffleruby, because just `rake` runs cucumber
# which fails because it uses an old childprocess which depends on fork.
- name: Run specs (truffleruby)
run: bundle exec rake spec
if: matrix.ruby-version == 'truffleruby-head'
1 change: 1 addition & 0 deletions Rakefile
Expand Up @@ -29,4 +29,5 @@ Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w[--retry 3 --no-strict-flaky]
end

task test: %i[spec cucumber]
task default: %i[rubocop spec cucumber]

0 comments on commit e024e75

Please sign in to comment.