ruby-sdk/.github/workflows/ci.yml
Koichi ITO 3477406afe 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"`:
6b49222edb/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.
2025-05-28 01:32:23 +09:00

35 lines
981 B
YAML

name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
entry:
- { ruby: 3.2, allowed-failure: false }
- { ruby: 3.3, allowed-failure: false }
- { ruby: 3.4, allowed-failure: false }
- { ruby: head, allowed-failure: true }
name: Test Ruby ${{ matrix.entry.ruby }}
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.entry.ruby }}
bundler-cache: false
- name: Bundle install
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