name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
    types: [opened, synchronize, reopened]

jobs:
  ci:
    # The type of runner that the job will run on
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-24.04]
        ruby:
          [
            "2.3",
            "2.4",
            "2.5",
            "2.6",
            "2.7",
            "3.0",
            "3.1",
            "3.2",
            "3.3",
            "3.4",
            "4.0",
            jruby,
          ]
    env:
      CC_TEST_REPORTER_ID: 20a1139ef1830b4f813a10a03d90e8aa179b5226f75e75c5a949b25756ebf558

    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v6

      - name: Setup ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true

      - name: ruby version
        run: ruby -v

      - name: Run rspec
        run: bundle exec rspec
