name: CI
on: [push, pull_request, workflow_dispatch]

jobs:
  test:
    if: "!contains(github.event.head_commit.message, 'ci skip')"

    continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}

    strategy:
      fail-fast: false

      matrix:
        os: [ubuntu]
        ruby: [2.4, 2.5, 2.6, 2.7, '3.0', 3.1, 3.2, 3.3, 3.4]

    runs-on: ${{ matrix.os }}-latest

    steps:
      - uses: actions/checkout@v4

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

      - run: bundle exec rspec
