From 3477406afe897c2676512419b95cf57f061e1101 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Tue, 27 May 2025 16:02:07 +0900 Subject: [PATCH] Enable RuboCop on CI When running `bundle exec rake` in the local environment, RuboCop is executed, but it was not included in the CI workflow. This PR enables RuboCop execution in the CI workflow. RuboCop performs static analysis on the source code using Ruby 3.2, in accordance with the gemspec setting `spec.required_ruby_version = ">= 3.2.0"`: https://github.com/modelcontextprotocol/ruby-sdk/blob/6b49222edb8709821a58bbe39cb85fd5409882eb/model_context_protocol.gemspec#L16 In other words, it is not necessary to run RuboCop under every Ruby version from 3.2 to head, so it is defined as a separate job from the test job. --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 567689ee..b737737b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,3 +22,14 @@ jobs: run: bundle install - run: bundle exec rake test continue-on-error: ${{ matrix.entry.allowed-failure }} + + rubocop: + runs-on: ubuntu-latest + name: RuboCop + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2 # Specify the oldest supported Ruby version. + bundler-cache: true + - run: bundle exec rake rubocop