From 7752d5c45dda20d56441046649840c4877559aee Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 29 May 2024 15:16:20 +0200 Subject: [PATCH] Move to GitHub actions * `rubocophq/circleci-ruby-snapshot` doesn't work anymore * Add ruby 3.3 --- .circleci/config.yml | 61 -------------------------- .github/workflows/main.yml | 38 ++++++++++++++++ spec/rubocop/cop/rubycw/rubycw_spec.rb | 8 +++- 3 files changed, 45 insertions(+), 62 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/main.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index ae500cb..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,61 +0,0 @@ -version: 2 - -steps: &steps - steps: - - checkout - - run: bundle install - - run: bundle exec rake - -jobs: - ruby-2.4: - docker: - - image: cimg/ruby:2.4 - <<: *steps - - ruby-2.5: - docker: - - image: cimg/ruby:2.5 - <<: *steps - - ruby-2.6: - docker: - - image: cimg/ruby:2.6 - <<: *steps - - ruby-2.7: - docker: - - image: cimg/ruby:2.7 - <<: *steps - - ruby-3.0: - docker: - - image: cimg/ruby:3.0 - <<: *steps - - ruby-3.1: - docker: - - image: cimg/ruby:3.1 - <<: *steps - - ruby-3.2: - docker: - - image: cimg/ruby:3.2 - <<: *steps - - ruby-head: - docker: - - image: rubocophq/circleci-ruby-snapshot:latest - <<: *steps - -workflows: - version: 2 - build: - jobs: - - ruby-2.4 - - ruby-2.5 - - ruby-2.6 - - ruby-2.7 - - ruby-3.0 - - ruby-3.1 - - ruby-3.2 - - ruby-head diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..168edd2 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,38 @@ +name: CI + +on: + pull_request: + push: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + main: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: + - "2.4" + - "2.5" + - "2.6" + - "2.7" + - "3.0" + - "3.1" + - "3.2" + - "3.3" + - ruby-head + task: + - spec + name: Ruby ${{ matrix.ruby }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: bundle exec rake diff --git a/spec/rubocop/cop/rubycw/rubycw_spec.rb b/spec/rubocop/cop/rubycw/rubycw_spec.rb index 441af4f..b3b62be 100644 --- a/spec/rubocop/cop/rubycw/rubycw_spec.rb +++ b/spec/rubocop/cop/rubycw/rubycw_spec.rb @@ -2,9 +2,15 @@ RSpec.describe RuboCop::Cop::Rubycw::Rubycw, :config do it 'registers an offense with ruby -cw' do + literal_unused_warning = if RUBY_VERSION < "3.3" + "unused literal ignored" + else + "possibly useless use of a literal in void context" + end + expect_offense(<<~RUBY) 1 - ^ unused literal ignored + ^ #{literal_unused_warning} p 1 p if /re/