From e024e755601773513889728d66a84e70efd796c9 Mon Sep 17 00:00:00 2001 From: Tobias Pfeiffer Date: Mon, 15 Apr 2024 21:16:46 +0200 Subject: [PATCH] Run Rubocop only once in CI No need to keep running rubocop, can esp. even be a bit slow on JRuby --- .github/workflows/stable.yml | 12 ++++++++---- .github/workflows/unstable.yml | 7 +++---- Rakefile | 1 + 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 6e128b11..c6c51d3b 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -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' diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml index 037384c8..43d4abb1 100644 --- a/.github/workflows/unstable.yml +++ b/.github/workflows/unstable.yml @@ -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' diff --git a/Rakefile b/Rakefile index 9e8336ed..e9c2273b 100644 --- a/Rakefile +++ b/Rakefile @@ -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]