name: Run tests
on: [push, pull_request]
jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4', '4.0', 'head']
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v6
    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
        bundler: ${{ (matrix.ruby < '3' && '2.4.21') || 'latest' }}
        bundler-cache: true # runs 'bundle install' and caches installed gems automatically
    - run: bundle exec thor spec
