name: Tests

on:

pull_request:
  branches: [main]
push:
  branches: [main]

jobs:

test:
  if: "!contains(github.event.head_commit.message, '[skip ci]')"
  runs-on: ubuntu-latest
  strategy:
    fail-fast: false
    matrix:
      include:
        - ruby: 3.3
        - ruby: 3.2
        - ruby: 3.1
        - ruby: 3.0
        - ruby: 2.7
  env:
    CI: true
  steps:
    - uses: actions/checkout@v4

    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
        bundler-cache: true
        rubygems: latest

    - name: Run tests
      run: bundle exec rake